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
ConstructorDescriptionCreates a new instance withFacesContext.getCurrentInstance()
.StrutsContext
(FacesContext facesContext) Create a new instance with giveFacesContext
. -
Method Summary
Modifier and TypeMethodDescriptionReturn theActionEvent
for the current request (if any).Return theActionMapping
for the current request (if any).Return theActionMessages
instance containing application error messages for this request (if any).Return theActionServlet
instance for this web application.Return the exception that caused one of the Struts custom tags to report a JspException (if any).Return theExternalContext
for the current request.Return theFacesContext
for the current request.Return theLocale
stored in the current user's session (if any) for Struts based localization.Return theMessageResources
instance for the application module that is processing this request (if any).Return theModuleConfig
for the application module to which this request has been assigned (if any).static ModuleConfig
getModuleConfig
(ExternalContext externalContext) Return theModuleConfig
for the application module to which this request has been assigned (if any).static ModuleConfig
getModuleConfig
(FacesContext facesContext) Return theModuleConfig
for the application module to which this request has been assigned (if any).boolean
Returntrue
if a Boolean true value has been stored in the request attribute indicating that this request has been cancelled.static String
uri
(FacesContext context) Return the absolute URI to be rendered as the value of thehref
attribute.
-
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 theActionEvent
for the current request (if any). -
getActionMapping
Return theActionMapping
for the current request (if any). -
getActionMessages
Return theActionMessages
instance containing application error messages for this request (if any). -
getActionServlet
Return theActionServlet
instance for this web application. -
isCancelled
public boolean isCancelled()Returntrue
if 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 theExternalContext
for the current request. -
getFacesContext
Return theFacesContext
for the current request. -
getLocale
Return theLocale
stored in the current user's session (if any) for Struts based localization. -
getMessageResources
Return theMessageResources
instance for the application module that is processing this request (if any). -
getModuleConfig
Return theModuleConfig
for the application module to which this request has been assigned (if any).- Returns:
- the
ModuleConfig
for the application module - Throws:
IllegalArgumentException
- if noModuleConfig
can be found
-
getModuleConfig
Return theModuleConfig
for the application module to which this request has been assigned (if any).- Parameters:
facesContext
- The givenFacesContext
- Returns:
- the
ModuleConfig
for the application module - Throws:
IllegalArgumentException
- if noModuleConfig
can be found
-
getModuleConfig
Return theModuleConfig
for the application module to which this request has been assigned (if any).- Parameters:
externalContext
- The givenExternalContext
- Returns:
- the
ModuleConfig
for the application module - Throws:
IllegalArgumentException
- if noModuleConfig
can be found
-
uri
Return the absolute URI to be rendered as the value of thehref
attribute.- Parameters:
context
-FacesContext
for the current request- Throws:
IllegalArgumentException
- Request is neitherHttpServletRequest
norPortletRequest
.
-