Class RequestContext

  • Direct Known Subclasses:
    MockRequestContext

    public class RequestContext
    extends Object
    Provides Servlet API request context object.
    • Method Detail

      • getServletContext

        public ServletContext getServletContext()
        Return the servlet context object.
        Returns:
        the servlet context object
      • getResponse

        public HttpServletResponse getResponse()
        Return the servlet response object.
        Returns:
        the servlet response object
      • getRequest

        public HttpServletRequest getRequest()
        Return the servlet request object.
        Returns:
        the servlet request object
      • getSession

        public HttpSession getSession()
        Return the servlet session object.
        Returns:
        the servlet session object
      • getThreadRequestContext

        public static RequestContext getThreadRequestContext()
        Return the request context object for the current thread.
        Returns:
        the request context object for the current thread
      • getThreadRequest

        public static HttpServletRequest getThreadRequest()
        Returns:
        the thread local HtttpServletRequest if defined or null otherwise.
        Since:
        4.3.2
      • bindThreadRequestContext

        public static void bindThreadRequestContext​(RequestContext requestContext)
        Bind the request context to the current thread.
        Parameters:
        requestContext - the request context
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        the string representation of this object