Class StaticHttpContext
java.lang.Object
com.atlassian.confluence.web.context.StaticHttpContext
- All Implemented Interfaces:
HttpContext
Makes static calls to Struts then ServletContextThreadLocal to retrieve the relevant objects for the current HTTP request.
Use this class rather than making static calls to those classes directly.
- Since:
- 2.9
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.servlet.http.HttpServletRequest
Returns the active HTTP request ornull
if one cannot be found.jakarta.servlet.http.HttpServletResponse
Returns the active HTTP response ornull
if one cannot be found.jakarta.servlet.http.HttpSession
getActiveSession
(boolean create) Returns the session associated with the active request or, if there is no current session andcreate
istrue
, returns a new session.
-
Constructor Details
-
StaticHttpContext
public StaticHttpContext()
-
-
Method Details
-
getActiveRequest
public jakarta.servlet.http.HttpServletRequest getActiveRequest()Description copied from interface:HttpContext
Returns the active HTTP request ornull
if one cannot be found.- Specified by:
getActiveRequest
in interfaceHttpContext
-
getActiveResponse
public jakarta.servlet.http.HttpServletResponse getActiveResponse()Description copied from interface:HttpContext
Returns the active HTTP response ornull
if one cannot be found.- Specified by:
getActiveResponse
in interfaceHttpContext
-
getActiveSession
public jakarta.servlet.http.HttpSession getActiveSession(boolean create) Description copied from interface:HttpContext
Returns the session associated with the active request or, if there is no current session andcreate
istrue
, returns a new session.- Specified by:
getActiveSession
in interfaceHttpContext
- Parameters:
create
- should betrue
to create a new session for the current request orfalse
to returnnull
if there is no current session- Returns:
- the HttpSession associated with this request or
null
ifcreate
is false and the request has no session
-