- All Known Implementing Classes:
DefaultHttpSession
public interface HttpSession
The HttpSession API.
- Author:
- Manfred Riem ([email protected])
-
Method Summary
Modifier and Type Method Description java.lang.Object
getAttribute(java.lang.String name)
Get the attribute.java.util.Enumeration<java.lang.String>
getAttributeNames()
Get the attribute names.long
getCreationTime()
Get the creation time.java.lang.String
getId()
Get the id.long
getLastAccessedTime()
Get the last accessed time.int
getMaxInactiveInterval()
Get the max inactive interval.ServletContext
getServletContext()
Get the Servlet context.HttpSessionContext
getSessionContext()
Deprecated.java.lang.Object
getValue(java.lang.String name)
Deprecated.java.lang.String[]
getValueNames()
Deprecated.void
invalidate()
Invalidate the HTTP session.boolean
isNew()
Is the HTTP session new.void
putValue(java.lang.String name, java.lang.Object value)
Deprecated.void
removeAttribute(java.lang.String name)
Remove the attribute.void
removeValue(java.lang.String name)
Deprecated.void
setAttribute(java.lang.String name, java.lang.Object value)
Set the attribute.void
setMaxInactiveInterval(int interval)
Set the max inactive interval.
-
Method Details
-
getAttribute
java.lang.Object getAttribute(java.lang.String name)Get the attribute.- Parameters:
name
- the name.- Returns:
- the value, or null if not found.
-
getAttributeNames
java.util.Enumeration<java.lang.String> getAttributeNames()Get the attribute names.- Returns:
- the attribute names.
-
getCreationTime
long getCreationTime()Get the creation time.- Returns:
- the creation time.
-
getId
java.lang.String getId()Get the id.- Returns:
- the id.
-
getLastAccessedTime
long getLastAccessedTime()Get the last accessed time.- Returns:
- the last accessed time.
-
getMaxInactiveInterval
int getMaxInactiveInterval()Get the max inactive interval.- Returns:
- the max inactive interval.
-
getServletContext
ServletContext getServletContext()Get the Servlet context.- Returns:
- the Servlet context.
-
getSessionContext
Deprecated.Get the HTTP session context.- Returns:
- the HTTP session context.
-
getValue
@Deprecated java.lang.Object getValue(java.lang.String name)Deprecated.Get the value.- Parameters:
name
- the name.- Returns:
- the value.
-
getValueNames
@Deprecated java.lang.String[] getValueNames()Deprecated.Get the value names.- Returns:
- the value names.
-
invalidate
void invalidate()Invalidate the HTTP session. -
isNew
boolean isNew()Is the HTTP session new.- Returns:
- true if it is, false otherwise.
-
putValue
@Deprecated void putValue(java.lang.String name, java.lang.Object value)Deprecated.Put the value.- Parameters:
name
- the name.value
- the value.
-
removeAttribute
void removeAttribute(java.lang.String name)Remove the attribute.- Parameters:
name
- the name.
-
removeValue
@Deprecated void removeValue(java.lang.String name)Deprecated.Remove the value.- Parameters:
name
- the name.
-
setAttribute
void setAttribute(java.lang.String name, java.lang.Object value)Set the attribute.- Parameters:
name
- the name.value
- the value.
-
setMaxInactiveInterval
void setMaxInactiveInterval(int interval)Set the max inactive interval.- Parameters:
interval
- the max inactive interval.
-