Package org.craftercms.commons.http
Class RequestContext
- java.lang.Object
-
- org.craftercms.commons.http.RequestContext
-
public class RequestContext extends Object
Holds the current HTTP servlet request and response.- Author:
- avasquez
-
-
Constructor Summary
Constructors Constructor Description RequestContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
clear()
Removes the context from the current thread.static RequestContext
getCurrent()
Returns the context for the current thread.javax.servlet.http.HttpServletRequest
getRequest()
Returns the current request.javax.servlet.http.HttpServletResponse
getResponse()
Returns the current response.javax.servlet.ServletContext
getServletContext()
Returns the current servlet context.static void
setCurrent(RequestContext current)
Sets the context for the current thread.void
setRequest(javax.servlet.http.HttpServletRequest request)
Returns the current request.void
setResponse(javax.servlet.http.HttpServletResponse response)
Sets the current response.void
setServletContext(javax.servlet.ServletContext servletContext)
Sets the current servlet context.
-
-
-
Method Detail
-
getCurrent
public static RequestContext getCurrent()
Returns the context for the current thread.
-
setCurrent
public static void setCurrent(RequestContext current)
Sets the context for the current thread.
-
clear
public static void clear()
Removes the context from the current thread.
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
Returns the current request.
-
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request)
Returns the current request.
-
getResponse
public javax.servlet.http.HttpServletResponse getResponse()
Returns the current response.
-
setResponse
public void setResponse(javax.servlet.http.HttpServletResponse response)
Sets the current response.
-
getServletContext
public javax.servlet.ServletContext getServletContext()
Returns the current servlet context.
-
setServletContext
public void setServletContext(javax.servlet.ServletContext servletContext)
Sets the current servlet context.
-
-