Class SessionHolder
- java.lang.Object
-
- org.jboss.weld.module.web.servlet.SessionHolder
-
public class SessionHolder extends Object
Holds the session associated with the current request. This utility class was added to work around an incompatibility problem with some Servlet containers (JBoss Web, Tomcat). In these containers,HttpServletRequest.getSession(boolean)cannot be used withinHttpSessionListener#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 anHttpSessiononce it is created and holds it until the request is destroyed / session is invalidated.- Author:
- Jozef Hartinger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclear()static jakarta.servlet.http.HttpSessiongetSession(jakarta.servlet.http.HttpServletRequest request, boolean create)static jakarta.servlet.http.HttpSessiongetSessionIfExists()static voidrequestInitialized(jakarta.servlet.http.HttpServletRequest request)static voidsessionCreated(jakarta.servlet.http.HttpSession session)
-
-
-
Method Detail
-
requestInitialized
public static void requestInitialized(jakarta.servlet.http.HttpServletRequest request)
-
sessionCreated
public static void sessionCreated(jakarta.servlet.http.HttpSession session)
-
getSessionIfExists
public static jakarta.servlet.http.HttpSession getSessionIfExists()
-
getSession
public static jakarta.servlet.http.HttpSession getSession(jakarta.servlet.http.HttpServletRequest request, boolean create)
-
clear
public static void clear()
-
-