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.HttpServletRequestReturns the active HTTP request ornullif one cannot be found.jakarta.servlet.http.HttpServletResponseReturns the active HTTP response ornullif one cannot be found.jakarta.servlet.http.HttpSessiongetActiveSession(boolean create) Returns the session associated with the active request or, if there is no current session andcreateistrue, returns a new session.
-
Constructor Details
-
StaticHttpContext
public StaticHttpContext()
-
-
Method Details
-
getActiveRequest
public jakarta.servlet.http.HttpServletRequest getActiveRequest()Description copied from interface:HttpContextReturns the active HTTP request ornullif one cannot be found.- Specified by:
getActiveRequestin interfaceHttpContext
-
getActiveResponse
public jakarta.servlet.http.HttpServletResponse getActiveResponse()Description copied from interface:HttpContextReturns the active HTTP response ornullif one cannot be found.- Specified by:
getActiveResponsein interfaceHttpContext
-
getActiveSession
public jakarta.servlet.http.HttpSession getActiveSession(boolean create) Description copied from interface:HttpContextReturns the session associated with the active request or, if there is no current session andcreateistrue, returns a new session.- Specified by:
getActiveSessionin interfaceHttpContext- Parameters:
create- should betrueto create a new session for the current request orfalseto returnnullif there is no current session- Returns:
- the HttpSession associated with this request or
nullifcreateis false and the request has no session
-