Package org.apache.struts.faces.util
Class StrutsContext
java.lang.Object
org.apache.struts.faces.util.StrutsContext
Context bean providing accessors for the Struts related request,
session, and application scope objects related to this request. Note
that this bean's methods will trigger exceptions unless there is a
FacesContext instance for this request.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance withFacesContext.getCurrentInstance().StrutsContext(FacesContext facesContext) Create a new instance with giveFacesContext. -
Method Summary
Modifier and TypeMethodDescriptionReturn theActionEventfor the current request (if any).Return theActionMappingfor the current request (if any).Return theActionMessagesinstance containing application error messages for this request (if any).Return theActionServletinstance for this web application.Return the exception that caused one of the Struts custom tags to report a JspException (if any).Return theExternalContextfor the current request.Return theFacesContextfor the current request.Return theLocalestored in the current user's session (if any) for Struts based localization.Return theMessageResourcesinstance for the application module that is processing this request (if any).Return theModuleConfigfor the application module to which this request has been assigned (if any).static ModuleConfiggetModuleConfig(ExternalContext externalContext) Return theModuleConfigfor the application module to which this request has been assigned (if any).static ModuleConfiggetModuleConfig(FacesContext facesContext) Return theModuleConfigfor the application module to which this request has been assigned (if any).booleanReturntrueif a Boolean true value has been stored in the request attribute indicating that this request has been cancelled.static Stringuri(FacesContext context) Return the absolute URI to be rendered as the value of thehrefattribute.
-
Constructor Details
-
StrutsContext
public StrutsContext()Creates a new instance withFacesContext.getCurrentInstance(). -
StrutsContext
Create a new instance with giveFacesContext.- Parameters:
facesContext- The giveFacesContext
-
-
Method Details
-
getActionEvent
Return theActionEventfor the current request (if any). -
getActionMapping
Return theActionMappingfor the current request (if any). -
getActionMessages
Return theActionMessagesinstance containing application error messages for this request (if any). -
getActionServlet
Return theActionServletinstance for this web application. -
isCancelled
public boolean isCancelled()Returntrueif a Boolean true value has been stored in the request attribute indicating that this request has been cancelled. -
getException
Return the exception that caused one of the Struts custom tags to report a JspException (if any). -
getExternalContext
Return theExternalContextfor the current request. -
getFacesContext
Return theFacesContextfor the current request. -
getLocale
Return theLocalestored in the current user's session (if any) for Struts based localization. -
getMessageResources
Return theMessageResourcesinstance for the application module that is processing this request (if any). -
getModuleConfig
Return theModuleConfigfor the application module to which this request has been assigned (if any).- Returns:
- the
ModuleConfigfor the application module - Throws:
IllegalArgumentException- if noModuleConfigcan be found
-
getModuleConfig
Return theModuleConfigfor the application module to which this request has been assigned (if any).- Parameters:
facesContext- The givenFacesContext- Returns:
- the
ModuleConfigfor the application module - Throws:
IllegalArgumentException- if noModuleConfigcan be found
-
getModuleConfig
Return theModuleConfigfor the application module to which this request has been assigned (if any).- Parameters:
externalContext- The givenExternalContext- Returns:
- the
ModuleConfigfor the application module - Throws:
IllegalArgumentException- if noModuleConfigcan be found
-
uri
Return the absolute URI to be rendered as the value of thehrefattribute.- Parameters:
context-FacesContextfor the current request- Throws:
IllegalArgumentException- Request is neitherHttpServletRequestnorPortletRequest.
-