Package javax.servlet.http
Interface HttpSession
-
- All Known Implementing Classes:
DefaultHttpSession
,HazelcastHttpSession
public interface HttpSession
The HttpSession API.- Author:
- Manfred Riem ([email protected])
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Object
getAttribute(String name)
Get the attribute.Enumeration<String>
getAttributeNames()
Get the attribute names.long
getCreationTime()
Get the creation time.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.Object
getValue(String name)
Deprecated.String[]
getValueNames()
Deprecated.void
invalidate()
Invalidate the HTTP session.boolean
isNew()
Is the HTTP session new.void
putValue(String name, Object value)
Deprecated.void
removeAttribute(String name)
Remove the attribute.void
removeValue(String name)
Deprecated.void
setAttribute(String name, Object value)
Set the attribute.void
setMaxInactiveInterval(int interval)
Set the max inactive interval.
-
-
-
Method Detail
-
getAttribute
Object getAttribute(String name)
Get the attribute.- Parameters:
name
- the name.- Returns:
- the value, or null if not found.
-
getAttributeNames
Enumeration<String> getAttributeNames()
Get the attribute names.- Returns:
- the attribute names.
-
getCreationTime
long getCreationTime()
Get the creation time.- Returns:
- the creation time.
-
getId
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 HttpSessionContext getSessionContext()
Deprecated.Get the HTTP session context.- Returns:
- the HTTP session context.
-
getValue
@Deprecated Object getValue(String name)
Deprecated.Get the value.- Parameters:
name
- the name.- Returns:
- the value.
-
getValueNames
@Deprecated 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(String name, Object value)
Deprecated.Put the value.- Parameters:
name
- the name.value
- the value.
-
removeAttribute
void removeAttribute(String name)
Remove the attribute.- Parameters:
name
- the name.
-
removeValue
@Deprecated void removeValue(String name)
Deprecated.Remove the value.- Parameters:
name
- the name.
-
setAttribute
void setAttribute(String name, 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.
-
-