public class Session extends Object
Modifier and Type | Method and Description |
---|---|
<T> T |
attribute(String name)
Returns the object bound with the specified name in this session, or null if no object is bound under the name.
|
void |
attribute(String name,
Object value)
Binds an object to this session, using the name specified.
|
Set<String> |
attributes() |
long |
creationTime() |
String |
id() |
void |
invalidate()
Invalidates this session then unbinds any objects bound to it.
|
boolean |
isNew() |
long |
lastAccessedTime() |
int |
maxInactiveInterval() |
void |
maxInactiveInterval(int interval)
Specifies the time, in seconds, between client requests the web container will invalidate this session.
|
javax.servlet.http.HttpSession |
raw() |
void |
removeAttribute(String name)
Removes the object bound with the specified name from this session.
|
public javax.servlet.http.HttpSession raw()
HttpSession
object handed in by the servlet container.public <T> T attribute(String name)
T
- The type parametername
- a string specifying the name of the objectpublic void attribute(String name, Object value)
name
- the name to which the object is bound; cannot be nullvalue
- the object to be boundpublic Set<String> attributes()
Enumeration
of String
objects
containing the names of all the objects bound to this session.public long creationTime()
public String id()
public long lastAccessedTime()
public int maxInactiveInterval()
public void maxInactiveInterval(int interval)
interval
- the intervalpublic void invalidate()
public boolean isNew()
public void removeAttribute(String name)
name
- the name of the object to remove from this sessionCopyright © 2014. All rights reserved.