public class SessionHolder extends Object
HttpServletRequest.getSession(boolean)
cannot be used within
HttpSessionListener#sessionCreated(HttpSession)
method invocation is the created session is not made available.
As a result either null is returned or a new session is created (possibly causing an endless loop).
This utility class receives an HttpSession
once it is created and holds it until the request is destroyed / session
is invalidated.https://issues.jboss.org/browse/AS7-6428
Modifier and Type | Method and Description |
---|---|
static void |
clear() |
static javax.servlet.http.HttpSession |
getSession(javax.servlet.http.HttpServletRequest request,
boolean create) |
static javax.servlet.http.HttpSession |
getSessionIfExists() |
static void |
requestInitialized(javax.servlet.http.HttpServletRequest request) |
static void |
sessionCreated(javax.servlet.http.HttpSession session) |
public static void requestInitialized(javax.servlet.http.HttpServletRequest request)
public static void sessionCreated(javax.servlet.http.HttpSession session)
public static javax.servlet.http.HttpSession getSessionIfExists()
public static javax.servlet.http.HttpSession getSession(javax.servlet.http.HttpServletRequest request, boolean create)
public static void clear()
Copyright © 2016. All rights reserved.