Package org.apache.struts2
Class ServletActionContext
java.lang.Object
org.apache.struts2.ServletActionContext
- All Implemented Interfaces:
- 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 SummaryFieldsFields inherited from interface org.apache.struts2.StrutsStaticsACTION_MAPPING, HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION
- 
Method SummaryModifier and TypeMethodDescriptionstatic ActionContextstatic ActionContextgetActionContext(jakarta.servlet.http.HttpServletRequest req) Gets the current action contextstatic ActionMappingGets the action mapping for this contextstatic jakarta.servlet.jsp.PageContextReturns the HTTP page context.static jakarta.servlet.http.HttpServletRequestGets the HTTP servlet request object.static jakarta.servlet.http.HttpServletResponseGets the HTTP servlet response object.static jakarta.servlet.ServletContextGets the servlet context.static ValueStackgetValueStack(jakarta.servlet.http.HttpServletRequest req) Gets the current value stack for this requeststatic voidsetRequest(jakarta.servlet.http.HttpServletRequest request) Sets the HTTP servlet request object.static voidsetResponse(jakarta.servlet.http.HttpServletResponse response) Sets the HTTP servlet response object.static voidsetServletContext(jakarta.servlet.ServletContext servletContext) Sets the current servlet context object
- 
Field Details- 
STRUTS_VALUESTACK_KEY- See Also:
 
 
- 
- 
Method Details- 
getActionContextGets the current action context- Parameters:
- req- The request
- Returns:
- The current action context
 
- 
getActionContext
- 
getValueStackGets the current value stack for this request- Parameters:
- req- The request
- Returns:
- The value stack
 
- 
getActionMappingGets the action mapping for this context- Returns:
- The action mapping
 
- 
getPageContextpublic static jakarta.servlet.jsp.PageContext getPageContext()Returns the HTTP page context.- Returns:
- the HTTP page context.
 
- 
setRequestpublic static void setRequest(jakarta.servlet.http.HttpServletRequest request) Sets the HTTP servlet request object.- Parameters:
- request- the HTTP servlet request object.
 
- 
getRequestpublic static jakarta.servlet.http.HttpServletRequest getRequest()Gets the HTTP servlet request object.- Returns:
- the HTTP servlet request object.
 
- 
setResponsepublic static void setResponse(jakarta.servlet.http.HttpServletResponse response) Sets the HTTP servlet response object.- Parameters:
- response- the HTTP servlet response object.
 
- 
getResponsepublic static jakarta.servlet.http.HttpServletResponse getResponse()Gets the HTTP servlet response object.- Returns:
- the HTTP servlet response object.
 
- 
getServletContextpublic static jakarta.servlet.ServletContext getServletContext()Gets the servlet context.- Returns:
- the servlet context.
 
- 
setServletContextpublic static void setServletContext(jakarta.servlet.ServletContext servletContext) Sets the current servlet context object- Parameters:
- servletContext- The servlet context to use
 
 
-