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, setServletContext
clearSubContext, contain, containNodeMap, createSubContext, existNodeMap, findNodeMap, getInSubContext, getItemMap, getParent, getSubContext, getSubContextMap, getTotalContext, getTotalItemMap, put, putContext, putSubContext, remove, removeSubContext, renameKey, renameKeyNodeMap, setParent
get, put, putAll, remove, setItemMap, size
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getObject, getRequest, getResponse, getServletContext, getWrappedWebContext, init, isRequestFinished, setObject, setRequest, setResponse, setServletContext
clearSubContext, createSubContext, getInSubContext, getItemMap, getParent, getSubContext, getSubContextMap, getTotalItemMap, put, putSubContext, remove, removeSubContext, setParent
public SessionWebContextImpl(WebContext wrappedContext, SessionConfig sessionConfig)
public SessionConfig getSessionConfig()
SessionConfig
实例。getSessionConfig
in interface SessionWebContext
SessionConfig
实例public boolean isSessionInvalidated()
isSessionInvalidated
in interface SessionWebContext
true
public void clear()
invalidate()
方法,但支持后续操作,而不会抛出
IllegalStateException
。clear
in interface BaseContext
clear
in interface SessionWebContext
clear
in class ContextImpl
public String getRequestedSessionID()
public boolean isRequestedSessionIDFromCookie()
true
public boolean isRequestedSessionIDFromURL()
true
public boolean isRequestedSessionIDValid()
true
public void encodeSessionIDIntoCookie()
public void clearSessionIDFromCookie()
public String decodeSessionIDFromCookie()
null
public String encodeSessionIDIntoURL(String url)
public String decodeSessionIDFromURL()
null
public javax.servlet.http.HttpSession getSession(boolean create)
create
为true
,则创建一个新的。create
- 必要时是否创建新的sessioncreate
为
false
,则返回null
public void commitHeaders() throws WebContextException
TwoPhaseCommitWebContext
commitHeaders
in interface TwoPhaseCommitWebContext
WebContextException
public void commit()
public boolean isIgnoreSessionTouch()
SessionWebContext
isIgnoreSessionTouch
in interface SessionWebContext
public void setIgnoreSessionTouch(boolean ignore)
setIgnoreSessionTouch
in interface SessionWebContext
Copyright © 2006–2018 TinyGroup. All rights reserved.