com.atlassian.confluence.web.context
Class StaticHttpContext

java.lang.Object
  extended by com.atlassian.confluence.web.context.StaticHttpContext
All Implemented Interfaces:
HttpContext

public class StaticHttpContext
extends java.lang.Object
implements HttpContext

Makes static calls to DWR then WebWork 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:
WebContextFactory, ServletActionContext, ServletContextThreadLocal

Constructor Summary
StaticHttpContext()
           
 
Method Summary
 javax.servlet.http.HttpServletRequest getRequest()
          Returns the active HTTP request or null if one cannot be found.
 javax.servlet.http.HttpServletResponse getResponse()
          Returns the active HTTP response or null if one cannot be found.
 javax.servlet.http.HttpSession getSession(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticHttpContext

public StaticHttpContext()
Method Detail

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Description copied from interface: HttpContext
Returns the active HTTP request or null if one cannot be found.

Specified by:
getRequest in interface HttpContext

getResponse

public javax.servlet.http.HttpServletResponse getResponse()
Description copied from interface: HttpContext
Returns the active HTTP response or null if one cannot be found.

Specified by:
getResponse in interface HttpContext

getSession

public javax.servlet.http.HttpSession getSession(boolean create)
Description copied from interface: HttpContext
Returns the session associated with the active request or, if there is no current session and create is true, returns a new session.

Specified by:
getSession in interface HttpContext
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


Copyright © 2003-2011 Atlassian. All Rights Reserved.