public class SessionWebContextImpl extends AbstractWebContextWrapper implements SessionWebContext
HttpRequestContext实现。REQUEST_ATTRIBUTE_FROM_WEBCONTEXT| Constructor and Description |
|---|
SessionWebContextImpl(WebContext wrappedContext,
SessionConfig sessionConfig)
构造函数。
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
清除session。类似
invalidate()方法,但支持后续操作,而不会抛出
IllegalStateException。 |
void |
clearSessionIDFromCookie()
将session ID从Cookie中删除。
|
void |
commit()
结束一个请求。
|
void |
commitHeaders()
提交headers
|
String |
decodeSessionIDFromCookie()
从cookie中取得session ID。
|
String |
decodeSessionIDFromURL()
从URL中取得session ID。
|
void |
encodeSessionIDIntoCookie()
将session ID编码到Cookie中去。
|
String |
encodeSessionIDIntoURL(String url)
将session ID编码到URL中去。
|
String |
getRequestedSessionID()
取得当前的session ID。
|
javax.servlet.http.HttpSession |
getSession(boolean create)
取得当前的session,如果不存在,且
create为true,则创建一个新的。 |
SessionConfig |
getSessionConfig()
取得
SessionConfig实例。 |
boolean |
isIgnoreSessionTouch()
是否忽略session最后访问时间更新
|
boolean |
isRequestedSessionIDFromCookie()
当前的session ID是从cookie中取得的吗?
|
boolean |
isRequestedSessionIDFromURL()
当前的session ID是从URL中取得的吗?
|
boolean |
isRequestedSessionIDValid()
判断当前的session ID是否仍然合法。
|
boolean |
isSessionInvalidated()
判断session是否已经作废。
|
void |
setIgnoreSessionTouch(boolean ignore) |
exist, existFromWrapperContext, get, getFromWrapperContext, getObject, getRequest, getResponse, getServletContext, getWrappedWebContext, getWrappedWebContext, init, isRequestFinished, putSubWebContext, setObject, setRequest, setResponse, setServletContextclearSubContext, contain, containNodeMap, createSubContext, existNodeMap, findNodeMap, getInSubContext, getItemMap, getParent, getSubContext, getSubContextMap, getTotalContext, getTotalItemMap, put, putContext, putSubContext, remove, removeSubContext, renameKey, renameKeyNodeMap, setParentget, put, putAll, remove, setItemMap, sizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetObject, getRequest, getResponse, getServletContext, getWrappedWebContext, init, isRequestFinished, setObject, setRequest, setResponse, setServletContextclearSubContext, createSubContext, getInSubContext, getItemMap, getParent, getSubContext, getSubContextMap, getTotalItemMap, put, putSubContext, remove, removeSubContext, setParentpublic SessionWebContextImpl(WebContext wrappedContext, SessionConfig sessionConfig)
public SessionConfig getSessionConfig()
SessionConfig实例。getSessionConfig in interface SessionWebContextSessionConfig实例public boolean isSessionInvalidated()
isSessionInvalidated in interface SessionWebContexttruepublic void clear()
invalidate()方法,但支持后续操作,而不会抛出
IllegalStateException。clear in interface BaseContextclear in interface SessionWebContextclear in class ContextImplpublic String getRequestedSessionID()
public boolean isRequestedSessionIDFromCookie()
truepublic boolean isRequestedSessionIDFromURL()
truepublic boolean isRequestedSessionIDValid()
truepublic void encodeSessionIDIntoCookie()
public void clearSessionIDFromCookie()
public String decodeSessionIDFromCookie()
nullpublic String encodeSessionIDIntoURL(String url)
public String decodeSessionIDFromURL()
nullpublic javax.servlet.http.HttpSession getSession(boolean create)
create为true,则创建一个新的。create - 必要时是否创建新的sessioncreate为
false ,则返回nullpublic void commitHeaders()
throws WebContextException
TwoPhaseCommitWebContextcommitHeaders in interface TwoPhaseCommitWebContextWebContextExceptionpublic void commit()
public boolean isIgnoreSessionTouch()
SessionWebContextisIgnoreSessionTouch in interface SessionWebContextpublic void setIgnoreSessionTouch(boolean ignore)
setIgnoreSessionTouch in interface SessionWebContextCopyright © 2006–2018 TinyGroup. All rights reserved.