接口 SessionManager

所有已知实现类:
DefaultSessionManager

public interface SessionManager
Main class for access to the WebSession for an HTTP request.
从以下版本开始:
2019-09-27 20:24
作者:
TODAY
另请参阅:
  • 字段详细资料

  • 方法详细资料

    • createSession

      WebSession createSession()
      create a new session
    • createSession

      WebSession createSession(RequestContext context)
      create a new session associated with RequestContext
    • getSession

      @Nullable WebSession getSession(@Nullable String sessionId)
      Get a session with given session id

      If there is not a session,create one.

    • getSession

      WebSession getSession(RequestContext context)
      Returns the current session associated with this request, or if the request does not have a session, creates one.
      参数:
      context - Current request
      返回:
      the WebSession associated with this request
      另请参阅:
    • getSession

      @Nullable WebSession getSession(RequestContext context, boolean create)
      Returns the current WebSession associated with this request or, if there is no current session and create is true, returns a new session.

      If create is false and the request has no valid WebSession, this method returns null.

      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.

      参数:
      context - Current request
      create - true to create a new session for this request if necessary; false to return null if there's no current session
      返回:
      the WebSession associated with this request or null if create is false and the request has no valid session
      另请参阅: