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
(jakarta.servlet.ServletContext context, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Instantiates a new request context. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
bindThreadRequestContext
(RequestContext requestContext) Bind the request context to the current thread.jakarta.servlet.http.HttpServletRequest
Return the servlet request object.jakarta.servlet.http.HttpServletResponse
Return the servlet response object.jakarta.servlet.ServletContext
Return the servlet context object.jakarta.servlet.http.HttpSession
Return the servlet session object.static jakarta.servlet.http.HttpServletRequest
static RequestContext
Return the request context object for the current thread.toString()
-
Constructor Details
-
RequestContext
public RequestContext(jakarta.servlet.ServletContext context, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Instantiates a new request context.- Parameters:
context
- the contextrequest
- the requestresponse
- the response
-
-
Method Details
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()Return the servlet context object.- Returns:
- the servlet context object
-
getResponse
public jakarta.servlet.http.HttpServletResponse getResponse()Return the servlet response object.- Returns:
- the servlet response object
-
getRequest
public jakarta.servlet.http.HttpServletRequest getRequest()Return the servlet request object.- Returns:
- the servlet request object
-
getSession
public jakarta.servlet.http.HttpSession 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
public static jakarta.servlet.http.HttpServletRequest 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
-