Class ServletActionContext

java.lang.Object
org.apache.struts2.ServletActionContext
All Implemented Interfaces:
StrutsStatics

public class ServletActionContext extends Object implements StrutsStatics
Web-specific context information for actions. This class subclasses ActionContext which provides access to things like the action name, value stack, etc. This class adds access to web objects like servlet parameters, request attributes and things like the HTTP session.
  • Field Details

  • Method Details

    • getActionContext

      public static ActionContext getActionContext(jakarta.servlet.http.HttpServletRequest req)
      Gets the current action context
      Parameters:
      req - The request
      Returns:
      The current action context
    • getActionContext

      public static ActionContext getActionContext()
    • getValueStack

      public static ValueStack getValueStack(jakarta.servlet.http.HttpServletRequest req)
      Gets the current value stack for this request
      Parameters:
      req - The request
      Returns:
      The value stack
    • getActionMapping

      public static ActionMapping getActionMapping()
      Gets the action mapping for this context
      Returns:
      The action mapping
    • getPageContext

      public static jakarta.servlet.jsp.PageContext getPageContext()
      Returns the HTTP page context.
      Returns:
      the HTTP page context.
    • setRequest

      public static void setRequest(jakarta.servlet.http.HttpServletRequest request)
      Sets the HTTP servlet request object.
      Parameters:
      request - the HTTP servlet request object.
    • getRequest

      public static jakarta.servlet.http.HttpServletRequest getRequest()
      Gets the HTTP servlet request object.
      Returns:
      the HTTP servlet request object.
    • setResponse

      public static void setResponse(jakarta.servlet.http.HttpServletResponse response)
      Sets the HTTP servlet response object.
      Parameters:
      response - the HTTP servlet response object.
    • getResponse

      public static jakarta.servlet.http.HttpServletResponse getResponse()
      Gets the HTTP servlet response object.
      Returns:
      the HTTP servlet response object.
    • getServletContext

      public static jakarta.servlet.ServletContext getServletContext()
      Gets the servlet context.
      Returns:
      the servlet context.
    • setServletContext

      public static void setServletContext(jakarta.servlet.ServletContext servletContext)
      Sets the current servlet context object
      Parameters:
      servletContext - The servlet context to use