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:
-
ServletActionContextServletContextThreadLocal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.servlet.http.HttpServletRequestReturns the active HTTP request or null if one cannot be found.javax.servlet.http.HttpServletResponseReturns the active HTTP response or null if one cannot be found.javax.servlet.http.HttpSessiongetSession(boolean create) Returns the session associated with the active request or, if there is no current session and create is true, returns a new session.
-
Constructor Details
-
StaticHttpContext
public StaticHttpContext()
-
-
Method Details
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()Description copied from interface:HttpContextReturns the active HTTP request or null if one cannot be found.- Specified by:
getRequestin interfaceHttpContext
-
getResponse
public javax.servlet.http.HttpServletResponse getResponse()Description copied from interface:HttpContextReturns the active HTTP response or null if one cannot be found.- Specified by:
getResponsein interfaceHttpContext
-
getSession
public javax.servlet.http.HttpSession getSession(boolean create) Description copied from interface:HttpContextReturns the session associated with the active request or, if there is no current session and create is true, returns a new session.- Specified by:
getSessionin interfaceHttpContext- Parameters:
create- should be true to create a new session for the current request or false to return null if there is no current session- Returns:
- the HttpSession associated with this request or null if create is false and the request has no session
-