Interface ConfigHelperInterface
- All Known Implementing Classes:
ConfigHelper
NOTE: THIS CLASS IS UNDER ACTIVE DEVELOPMENT. THE CURRENT CODE IS WRITTEN FOR CLARITY NOT EFFICIENCY. NOT EVERY API FUNCTION HAS BEEN IMPLEMENTED YET.
A helper object to expose the Struts shared resources, which are be stored in the application, session, or request contexts, as appropriate.
An instance should be created for each request processed. The methods which return resources from the request or session contexts are not thread-safe.
Provided for use by other servlets in the application so they can easily access the Struts shared resources.
The resources are stored under attributes in the application, session, or request contexts.
The ActionConfig methods simply return the resources from under the context and key used by the Struts ActionServlet when the resources are created.
- Since:
- Struts 1.1
- Version:
- $Rev$ $Date: 2005-05-07 12:11:38 -0400 (Sat, 07 May 2005) $
-
Method Summary
Modifier and TypeMethodDescriptionReturn the URL for the specified ActionMapping, otherwise returnnull
.Retrieve and return theActionForm
bean associated with this mapping, creating and stashing one if necessary.getActionForward
(String name) Return the forwarding associated with the specified logical name, if any; otherwise returnnull
.getActionMapping
(String path) Return the mapping associated with the specified request path, if any; otherwise returnnull
.getActionMappingName
(String action) Return the form action converted into an action mapping path.getActionMappingURL
(String action) Return the form action converted into a server-relative URL.Theorg.apache.struts.action.ActionFormBeans
collection for this application.Renders the reference for a HTMLelement getEncodeURL
(String url) Return the url encoded to maintain the user session, if any.The runtime JspException that may be been thrown by a Struts tag extension, or compatible presentation extension, and placed in the request.getFormBean
(String name) Return the form bean definition associated with the specified logical name, if any; otherwise returnnull
.Return the path for the specified forward, otherwise returnnull
.Theorg.apache.struts.ActionMapping
instance for this request.getMessage
(String key) Return the localized message for the specified key, otherwise returnnull
.getMessage
(String key, Object[] args) Look up and return a message string, based on the specified parameters.The application resources for this application.The multipart object for this request.Renders the reference for a HTMLelement The path-mapped pattern (/action/*
) or extension mapped pattern ((*.do
) used to determine our Action URIs in this application.getToken()
The transaction token stored in this session, if it is used.boolean
Return true if a message string for the specified message key is present for the user's Locale.
-
Method Details
-
getActionMessages
ActionMessages getActionMessages()The
org.apache.struts.action.ActionFormBeans
collection for this application. -
getMessageResources
MessageResources getMessageResources()The application resources for this application.
-
getServletMapping
String getServletMapping()The path-mapped pattern (
/action/*
) or extension mapped pattern ((*.do
) used to determine our Action URIs in this application. -
getToken
String getToken()The transaction token stored in this session, if it is used.
-
getException
Throwable getException()The runtime JspException that may be been thrown by a Struts tag extension, or compatible presentation extension, and placed in the request.
-
getMultipartRequestWrapper
MultipartRequestWrapper getMultipartRequestWrapper()The multipart object for this request.
-
getMapping
ActionMapping getMapping()The
org.apache.struts.ActionMapping
instance for this request. -
isMessage
Return true if a message string for the specified message key is present for the user's Locale.
- Parameters:
key
- Message key
-
getActionForm
ActionForm getActionForm()Retrieve and return the
ActionForm
bean associated with this mapping, creating and stashing one if necessary. If there is no form bean associated with this mapping, returnnull
. -
getFormBean
Return the form bean definition associated with the specified logical name, if any; otherwise return
null
.- Parameters:
name
- Logical name of the requested form bean definition
-
getActionForward
Return the forwarding associated with the specified logical name, if any; otherwise return
null
.- Parameters:
name
- Logical name of the requested forwarding
-
getActionMapping
Return the mapping associated with the specified request path, if any; otherwise return
null
.- Parameters:
path
- Request path for which a mapping is requested
-
getActionMappingName
Return the form action converted into an action mapping path. The value of the
action
property is manipulated as follows in computing the name of the requested mapping:- Any filename extension is removed (on the theory that extension mapping is being used to select the controller servlet).
- If the resulting value does not start with a slash, then a slash is prepended.
:FIXME: Bad assumption =:o)
-
getActionMappingURL
Return the form action converted into a server-relative URL.
-
getEncodeURL
Return the url encoded to maintain the user session, if any.
-
getOrigRef
String getOrigRef()Renders the reference for a HTML
element -
getBaseRef
String getBaseRef()Renders the reference for a HTML
element -
getLink
Return the path for the specified forward, otherwise return
null
.- Parameters:
name
- Name given to local or global forward.
-
getMessage
Return the localized message for the specified key, otherwise return
null
.- Parameters:
key
- Message key
-
getMessage
Look up and return a message string, based on the specified parameters.
- Parameters:
key
- Message key to be looked up and returnedargs
- Replacement parameters for this message
-
getAction
Return the URL for the specified ActionMapping, otherwise return
null
.- Parameters:
path
- Name given to local or global forward.
-