类 DefaultSessionManager
java.lang.Object
cn.taketoday.session.DefaultSessionManager
- 所有已实现的接口:
SessionManager
Default implementation of
SessionManager delegating to a
SessionIdResolver for session id resolution and to a
SessionRepository.- 从以下版本开始:
- 2019-09-27 19:58
- 作者:
- Harry Yang
-
字段概要
字段从接口继承的字段 cn.taketoday.session.SessionManager
BEAN_NAME -
构造器概要
构造器构造器说明DefaultSessionManager(SessionRepository sessionRepository, SessionIdResolver sessionIdResolver) -
方法概要
修饰符和类型方法说明create a new sessioncreateSession(RequestContext context) create a new session associated withRequestContextgetSession(RequestContext context) Returns the current session associated with this request, or if the request does not have a session, creates one.getSession(RequestContext context, boolean create) Returns the currentWebSessionassociated with this request or, if there is no current session andcreateis true, returns a new session.getSession(String sessionId) Get a session with given session idvoidsetSessionIdResolver(SessionIdResolver sessionIdResolver) voidsetSessionRepository(SessionRepository sessionRepository)
-
字段详细资料
-
sessionIdResolver
-
sessionRepository
-
-
构造器详细资料
-
DefaultSessionManager
public DefaultSessionManager(SessionRepository sessionRepository, @Nullable SessionIdResolver sessionIdResolver)
-
-
方法详细资料
-
setSessionRepository
-
setSessionIdResolver
-
createSession
从接口复制的说明:SessionManagercreate a new session- 指定者:
createSession在接口中SessionManager
-
createSession
从接口复制的说明:SessionManagercreate a new session associated withRequestContext- 指定者:
createSession在接口中SessionManager
-
getSession
从接口复制的说明:SessionManagerGet a session with given session idIf there is not a session,create one.
- 指定者:
getSession在接口中SessionManager
-
getSession
从接口复制的说明:SessionManagerReturns the current session associated with this request, or if the request does not have a session, creates one.- 指定者:
getSession在接口中SessionManager- 参数:
context- Current request- 返回:
- the
WebSessionassociated with this request - 另请参阅:
-
getSession
从接口复制的说明:SessionManagerReturns the currentWebSessionassociated with this request or, if there is no current session andcreateis true, returns a new session.If
createisfalseand the request has no validWebSession, this method returnsnull.To make sure the session is properly maintained, you must call this method before the response is committed. If the container is using cookies to maintain session integrity and is asked to create a new session when the response is committed, an IllegalStateException is thrown.
- 指定者:
getSession在接口中SessionManager- 参数:
context- Current requestcreate-trueto create a new session for this request if necessary;falseto returnnullif there's no current session- 返回:
- the
WebSessionassociated with this request ornullifcreateisfalseand the request has no valid session - 另请参阅:
-
getSessionIdResolver
-
getSessionRepository
-