Package org.craftercms.commons.http
Class RequestContext
java.lang.Object
org.craftercms.commons.http.RequestContext
Holds the current HTTP servlet request and response.
- Author:
- avasquez
-
Constructor Summary
ConstructorDescriptionRequestContext
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
Removes the context from the current thread.static RequestContext
Returns the context for the current thread.javax.servlet.http.HttpServletRequest
Returns the current request.javax.servlet.http.HttpServletResponse
Returns the current response.javax.servlet.ServletContext
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.
-
Constructor Details
-
RequestContext
public RequestContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
-
-
Method Details
-
getCurrent
Returns the context for the current thread. -
setCurrent
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.
-