Package com.avoka.fc.core.servlet
Class RequestContext
java.lang.Object
com.avoka.fc.core.servlet.RequestContext
- Direct Known Subclasses:
MockRequestContext
Provides Servlet API request context object.
-
Constructor Summary
ConstructorDescriptionRequestContext
(ServletContext context, HttpServletRequest request, HttpServletResponse response) Instantiates a new request context. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
bindThreadRequestContext
(RequestContext requestContext) Bind the request context to the current thread.Return the servlet request object.Return the servlet response object.Return the servlet context object.Return the servlet session object.static HttpServletRequest
static RequestContext
Return the request context object for the current thread.toString()
-
Constructor Details
-
RequestContext
public RequestContext(ServletContext context, HttpServletRequest request, HttpServletResponse response) Instantiates a new request context.- Parameters:
context
- the contextrequest
- the requestresponse
- the response
-
-
Method Details
-
getServletContext
Return the servlet context object.- Returns:
- the servlet context object
-
getResponse
Return the servlet response object.- Returns:
- the servlet response object
-
getRequest
Return the servlet request object.- Returns:
- the servlet request object
-
getSession
Return the servlet session object.- Returns:
- the servlet session object
-
getThreadRequestContext
Return the request context object for the current thread.- Returns:
- the request context object for the current thread
-
getThreadRequest
- Returns:
- the thread local HtttpServletRequest if defined or null otherwise.
- Since:
- 4.3.2
-
bindThreadRequestContext
Bind the request context to the current thread.- Parameters:
requestContext
- the request context
-
toString
-