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

    Modifier and Type
    Method
    Description
    static void
    Removes the context from the current thread.
    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
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RequestContext

      public RequestContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
  • Method Details

    • 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.