HttpSession based on Session support.
| Modifier and Type | Field and Description |
|---|---|
| private final WebappContext | contextImpl
The ServletContext. |
| private static final Logger | |
| private final Session | session
The real session object |
| Access | Constructor and Description |
|---|---|
| public | HttpSessionImpl(final WebappContext contextImpl, final Session
internal session object session)Create an HttpSession. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public Object | getAttribute(String key)
Implements jakarta. Returns the object bound with the specified name in this session, or |
| public Enumeration | getAttributeNames()
Implements jakarta. Returns an |
| public long | getCreationTime()
Implements jakarta. Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT. |
| public String | getId()
Implements jakarta. Returns a string containing the unique identifier assigned to this session. |
| public long | getLastAccessedTime()
Implements jakarta. Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight January 1, 1970 GMT, and marked by the time the container received the request. |
| public int | getMaxInactiveInterval()
Implements jakarta. Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. |
| public ServletContext | getServletContext()
Implements jakarta. Returns the ServletContext to which this session belongs. |
| public synchronized void | invalidate()
Implements jakarta. Invalidates this session then unbinds any objects bound to it. |
| public boolean | isNew()
Implements jakarta. Returns |
| protected boolean | |
| protected void | notifyIdChanged(final String oldId)
Invoke to notify all registered |
| protected void | notifyNew()
Invoke to notify all registered |
| public void | removeAttribute(String key)
Implements jakarta. Removes the object bound with the specified name from this session. |
| public void | setAttribute(String key, Object value)
Implements jakarta. Binds an object to this session, using the name specified. |
| public void | setMaxInactiveInterval(int sessionTimeout)
Implements jakarta. Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. |
| contextImpl | back to summary |
|---|---|
| private final WebappContext contextImpl The ServletContext. | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| session | back to summary |
|---|---|
| private final Session session The real session object | |
| HttpSessionImpl | back to summary |
|---|---|
| public HttpSessionImpl(final WebappContext contextImpl, final Session session) Create an HttpSession.
| |
| access | back to summary |
|---|---|
| protected void access() Reset the timestamp. | |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(String key) Implements jakarta. Doc from jakarta. Returns the object bound with the specified name in this session, or
| |
| getAttributeNames | back to summary |
|---|---|
| public Enumeration Implements jakarta. Doc from jakarta. Returns an
| |
| getCreationTime | back to summary |
|---|---|
| public long getCreationTime() Implements jakarta. Doc from jakarta. Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT.
| |
| getId | back to summary |
|---|---|
| public String getId() Implements jakarta. Doc from jakarta. Returns a string containing the unique identifier assigned to this session. The identifier is assigned by the servlet container and is implementation dependent.
| |
| getLastAccessedTime | back to summary |
|---|---|
| public long getLastAccessedTime() Implements jakarta. Doc from jakarta. Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight January 1, 1970 GMT, and marked by the time the container received the request. Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time.
| |
| getMaxInactiveInterval | back to summary |
|---|---|
| public int getMaxInactiveInterval() Implements jakarta. Doc from jakarta. Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client
accesses. After this interval, the servlet container will invalidate the session. The maximum time interval can be
set with the A return value of zero or less indicates that the session will never timeout.
| |
| getServletContext | back to summary |
|---|---|
| public ServletContext getServletContext() Implements jakarta. Doc from jakarta. Returns the ServletContext to which this session belongs.
| |
| invalidate | back to summary |
|---|---|
| public synchronized void invalidate() Implements jakarta. Doc from jakarta. Invalidates this session then unbinds any objects bound to it.
| |
| isNew | back to summary |
|---|---|
| public boolean isNew() Implements jakarta. Doc from jakarta. Returns
| |
| isValid | back to summary |
|---|---|
| protected boolean isValid() Is the current Session valid?
| |
| notifyIdChanged | back to summary |
|---|---|
| protected void notifyIdChanged(final String oldId) Invoke to notify all registered | |
| notifyNew | back to summary |
|---|---|
| protected void notifyNew() Invoke to notify all registered | |
| removeAttribute | back to summary |
|---|---|
| public void removeAttribute(String key) Implements jakarta. Doc from jakarta. Removes the object bound with the specified name from this session. If the session does not have an object bound with the specified name, this method does nothing.
After this method executes, and if the object implements
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(String key, Object value) Implements jakarta. Doc from jakarta. Binds an object to this session, using the name specified. If an object of the same name is already bound to the session, the object is replaced.
After this method executes, and if the new object implements
If an object was already bound to this session of this name that implements
If the value passed in is null, this has the same effect as calling
| |
| setMaxInactiveInterval | back to summary |
|---|---|
| public void setMaxInactiveInterval(int sessionTimeout) Implements jakarta. Doc from jakarta. Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. An interval value of zero or less indicates that the session should never timeout.
| |