| org.apache.struts.chain.contexts.ActionContext
All known Subclasses: org.apache.struts.chain.contexts.ActionContextBase,
ActionContext | public interface ActionContext extends Context(Code) | | An ActionContext represents a view of a commons-chain
Context which encapsulates access to request and
session-scoped resources and services
|
Method Summary | |
void | addErrors(ActionMessages errors) Append the given errors keys to an internal cache, creating the
cache if one is not already present. | void | addMessages(ActionMessages messages) Append the given messages keys to an internal cache, creating the
cache if one is not already present. | String | generateToken() | Action | getAction() Get the action which has been identified to be executed as part of
processing this request. | ActionConfig | getActionConfig() Get the ActionConfig which contains the details for processing this
request. | ActionForm | getActionForm() Get the ActionForm instance which will carry any data submitted as
part of this request. | Map | getApplicationScope() | Boolean | getCancelled() | ActionMessages | getErrors() Retrieve error messages from an internal cache, creating an empty
cache if one is not already present. | Exception | getException() Retrieve an exception which may have been caught by some code using
this ActionContext, usually by an exception handler. | Boolean | getFormValid() Is the ActionForm for this context valid? This method does
not actually perform form validation. | ForwardConfig | getForwardConfig() Get the ForwardConfig which has been identified as the basis for
view-processing. | String | getInclude() Get the include path which should be processed as part of
processing this request. | Locale | getLocale() | MessageResources | getMessageResources() | MessageResources | getMessageResources(String key) | ActionMessages | getMessages() Retrieve messages from an internal cache, creating an empty cache
if one is not already present. | ModuleConfig | getModuleConfig() Get the ModuleConfig which is operative for the current request. | Map | getParameterMap() Return a Map of parameters submitted by the user as
part of this request. | Map | getRequestScope() Return a Map of request scoped values. | Map | getScope(String scopeName) Return the Map representing the scope identified by
scopeName . | Map | getSessionScope() Return a Map of Session scoped values. | boolean | isTokenValid() Indicate whether a transaction token for this context is valid.
A typical implementation will place a transaction token in the
session" scope Map and a matching value in the "parameter" Map. | boolean | isTokenValid(boolean reset) Indicate whether a transaction token is stored in the "session"
scope for this context, optionally clearing the token, so that the next
check would return false. | void | release() Signal to the instance that it will not be used any more, so that any
resources which should be cleaned up can be cleaned up. | void | resetToken() Clear any transactional token stored in the "session" scope for
this context, so that the next check would return false. | void | saveErrors(ActionMessages errors) Save the given error messages to the internal cache, clearing any
previous messages in the cache. | void | saveMessages(ActionMessages messages) Save the given messages to the internal cache, clearing any
previous messages in the cache. | void | saveMessages(String scope, ActionMessages messages) Save the given messages to the internal cache, clearing any
previous messages in the cache, but only for the specified scope. | void | saveToken() Save a new transaction token in the "session" scope for this
context, creating new resources, if needed. | void | setAction(Action action) Set the action which has been identified to be executed as part of
processing this request. | void | setActionConfig(ActionConfig config) Set the ActionConfig class contains the details for processing this
request. | void | setActionForm(ActionForm form) Set the ActionForm instance which will carry any data submitted as
part of this request. | void | setCancelled(Boolean cancelled) Set the "cancel event" state for this context. | void | setException(Exception e) Store an exception in this context for use by other handling code. | void | setFormValid(Boolean valid) Store the result of the validation of the Context's ActionForm. | void | setForwardConfig(ForwardConfig forward) Set the ForwardConfig which should be used as the basis of the view
segment of the overall processing. | void | setInclude(String include) Set the include path which should be processed as part of
processing this request. | void | setLocale(Locale locale) | void | setMessageResources(MessageResources resources) | void | setModuleConfig(ModuleConfig config) Set the ModuleConfig which is operative for the current request. |
APPLICATION_SCOPE | final public static String APPLICATION_SCOPE(Code) | | |
addErrors | void addErrors(ActionMessages errors)(Code) | | Append the given errors keys to an internal cache, creating the
cache if one is not already present.
Parameters: errors - New ActionMessages to cache as errors |
addMessages | void addMessages(ActionMessages messages)(Code) | | Append the given messages keys to an internal cache, creating the
cache if one is not already present.
Parameters: messages - New ActionMessages to cache |
generateToken | String generateToken()(Code) | | Generate a new transaction token, to be used for enforcing a single
request for a particular transaction.
|
getAction | Action getAction()(Code) | | Get the action which has been identified to be executed as part of
processing this request.
The action to be executed with this request |
getActionConfig | ActionConfig getActionConfig()(Code) | | Get the ActionConfig which contains the details for processing this
request.
The ActionConfig class being used with this request |
getActionForm | ActionForm getActionForm()(Code) | | Get the ActionForm instance which will carry any data submitted as
part of this request.
The ActionForm being used with this request |
getApplicationScope | Map getApplicationScope()(Code) | | Return a Map of Application scoped values.
This is implemented in analogy with the Application scope in the
Servlet API, but it seems reasonable to expect that any Struts
implementation will have an equivalent concept.
The ultimate meaning of "application scope" is an implementation
detail left unspecified by Struts.
A Map of "application scope" attributes. |
getErrors | ActionMessages getErrors()(Code) | | Retrieve error messages from an internal cache, creating an empty
cache if one is not already present.
The ActionMessage cache for errors |
getException | Exception getException()(Code) | | Retrieve an exception which may have been caught by some code using
this ActionContext, usually by an exception handler.
Any exception that may have been caught by this ActionContext |
getFormValid | Boolean getFormValid()(Code) | | Is the ActionForm for this context valid? This method does
not actually perform form validation. It is simply a holder
property where processes which perform validation can store the results
of the validation for other processes' benefit.
Boolean.TRUE if the form passed validation;Boolean.FALSE if the form failed validation; nullif the form has not yet been validated |
getForwardConfig | ForwardConfig getForwardConfig()(Code) | | Get the ForwardConfig which has been identified as the basis for
view-processing.
The ForwardConfig being used with this request |
getInclude | String getInclude()(Code) | | Get the include path which should be processed as part of
processing this request.
The include path being used with this request |
getLocale | Locale getLocale()(Code) | | Return the user's currently selected Locale.
|
getMessageResources | MessageResources getMessageResources()(Code) | | Return the default message resources for the current module.
|
getMessageResources | MessageResources getMessageResources(String key)(Code) | | Return the specified message resources for the current module.
Parameters: key - The key specified in the <message-resources> element for the requested bundle |
getMessages | ActionMessages getMessages()(Code) | | Retrieve messages from an internal cache, creating an empty cache
if one is not already present.
The ActionMessage cache for errors |
getModuleConfig | ModuleConfig getModuleConfig()(Code) | | Get the ModuleConfig which is operative for the current request.
The MooduleConfig being used with this request |
getParameterMap | Map getParameterMap()(Code) | | Return a Map of parameters submitted by the user as
part of this request. The keys to this map will be request parameter
names (of type String ), and the values will be
String[] .
This is implemented in analogy with the Request parameters of the
Servlet API, but it seems reasonable to expect that any Struts
implementation will have an equivalent concept.
A map of the request parameter attributes |
getRequestScope | Map getRequestScope()(Code) | | Return a Map of request scoped values. A request is
understood as the fundamental motivation for any particular instance of
an ActionContext .
This is implemented in analogy with the Request Context in the
Servlet API, but it seems reasonable to expect that any Struts
implementation will have an equivalent concept.
The ultimate meaning of "request scope" is an implementation detail
left unspecified by Struts.
a Map of "request scope" attributes. |
getScope | Map getScope(String scopeName)(Code) | | Return the Map representing the scope identified by
scopeName . Implementations should support at minimum the
names associated with the constants APPLICATION_SCOPE ,
SESSION_SCOPE , and REQUEST_SCOPE , but are
permitted to support others as well.
Parameters: scopeName - A token identifying a scope, including but not limitedto APPLICATION_SCOPE , SESSION_SCOPE ,REQUEST_SCOPE . A Map of attributes for the specified scope. |
getSessionScope | Map getSessionScope()(Code) | | Return a Map of Session scoped values. A session is
understood as a sequence of requests made by the same user.
This is implemented in analogy with the Session scope in the Servlet
API, but it seems reasonable to expect that any Struts implementation
will have an equivalent concept.
The ultimate meaning of "session scope" is an implementation detail
left unspecified by Struts.
A Map of "session scope" attributes. |
isTokenValid | boolean isTokenValid()(Code) | | Indicate whether a transaction token for this context is valid.
A typical implementation will place a transaction token in the
session" scope Map and a matching value in the "parameter" Map. If the
"session" token does not match the "parameter" attribute, or the
session token is missing, then the transactional token is deemed
invalid.
|
isTokenValid | boolean isTokenValid(boolean reset)(Code) | | Indicate whether a transaction token is stored in the "session"
scope for this context, optionally clearing the token, so that the next
check would return false.
Parameters: reset - On true, clear the transactional token |
release | void release()(Code) | | Signal to the instance that it will not be used any more, so that any
resources which should be cleaned up can be cleaned up.
|
resetToken | void resetToken()(Code) | | Clear any transactional token stored in the "session" scope for
this context, so that the next check would return false.
|
saveErrors | void saveErrors(ActionMessages errors)(Code) | | Save the given error messages to the internal cache, clearing any
previous messages in the cache. If the parameter is null or
empty, the internal cache is removed.
Parameters: errors - ActionMesssages to cache as errors |
saveMessages | void saveMessages(ActionMessages messages)(Code) | | Save the given messages to the internal cache, clearing any
previous messages in the cache. If the parameter is null or
empty, the internal cache is removed.
Parameters: messages - ActionMesssages to cache |
saveMessages | void saveMessages(String scope, ActionMessages messages)(Code) | | Save the given messages to the internal cache, clearing any
previous messages in the cache, but only for the specified scope.
If the parameter is null or empty, the internal cache is removed.
Parameters: scope - The scope for the internal cache Parameters: messages - ActionMesssages to cache |
saveToken | void saveToken()(Code) | | Save a new transaction token in the "session" scope for this
context, creating new resources, if needed.
|
setAction | void setAction(Action action)(Code) | | Set the action which has been identified to be executed as part of
processing this request.
Parameters: action - |
setActionConfig | void setActionConfig(ActionConfig config)(Code) | | Set the ActionConfig class contains the details for processing this
request.
Parameters: config - The ActionConfig class to use with this request |
setActionForm | void setActionForm(ActionForm form)(Code) | | Set the ActionForm instance which will carry any data submitted as
part of this request.
Parameters: form - The ActionForm instance to use with this request |
setCancelled | void setCancelled(Boolean cancelled)(Code) | | Set the "cancel event" state for this context.
Parameters: cancelled - On true, set the cancel event state to true. On false,set the cancel event state to false. See Also: ActionContextBase.CANCEL_KEY |
setException | void setException(Exception e)(Code) | | Store an exception in this context for use by other handling code.
Parameters: e - An exception to be stored for handling by another member |
setFormValid | void setFormValid(Boolean valid)(Code) | | Store the result of the validation of the Context's ActionForm.
Parameters: valid - Whether the ActionForm for this request passes validation |
setForwardConfig | void setForwardConfig(ForwardConfig forward)(Code) | | Set the ForwardConfig which should be used as the basis of the view
segment of the overall processing. This is the primary method of
"communication" with the "view" sub-chain.
Parameters: forward - The ForwardConfig to use with this request |
setInclude | void setInclude(String include)(Code) | | Set the include path which should be processed as part of
processing this request.
Parameters: include - The include path to be used with this request |
setLocale | void setLocale(Locale locale)(Code) | | Set the user's currently selected Locale .
Parameters: locale - The user's selected Locale to be set, or null to selectthe server's default Locale |
setMessageResources | void setMessageResources(MessageResources resources)(Code) | | Set the default message resources for the current module.
|
setModuleConfig | void setModuleConfig(ModuleConfig config)(Code) | | Set the ModuleConfig which is operative for the current request.
Parameters: config - The ModuleConfig to be used with this request |
|
|