| java.lang.Object org.apache.struts.chain.contexts.ContextWrapper org.apache.struts.chain.contexts.ActionContextBase
All known Subclasses: org.apache.struts.chain.contexts.WebActionContext, org.apache.struts.chain.contexts.MockActionContext,
ActionContextBase | abstract public class ActionContextBase extends ContextWrapper implements ActionContext(Code) | | Provide an abstract but semi-complete implementation of ActionContext
to serve as the base for concrete implementations. The abstract
methods to implement are the accessors for the named states,
getApplicationScope , getRequestScope , and
getSessionScope .
|
Constructor Summary | |
public | ActionContextBase(Context context) Instantiate ActionContextBase, wrapping the given Context. | public | ActionContextBase() Instantiate ActionContextBase, wrapping a default ContextBase
instance. |
Method Summary | |
public void | addActionMessages(String key, ActionMessages messages) Add the given messages to a cache stored in this Context, under
key. | public void | addErrors(ActionMessages errors) | public void | addMessages(ActionMessages messages) | public ActionForm | findOrCreateActionForm(String formName, String scopeName) Using this ActionContext 's default
ModuleConfig , return an existing ActionForm
in the specified scope, or create a new one and add it to the specified
scope. | public ActionForm | findOrCreateActionForm(String formName, String scopeName, ModuleConfig moduleConfig) In the context of the given ModuleConfig and this
ActionContext , look for an existing
ActionForm in the specified scope. | public String | generateToken() | public Action | getAction() | public ActionConfig | getActionConfig() | public ActionForm | getActionForm() | abstract public Map | getApplicationScope() | public Boolean | getCancelled() | public ActionMessages | getErrors() | public Exception | getException() | public Boolean | getFormValid() | public ForwardConfig | getForwardConfig() | public String | getInclude() | public Locale | getLocale() | public Log | getLogger() Provide the currently configured commons-logging Log
instance. | public MessageResources | getMessageResources() | public MessageResources | getMessageResources(String key) | public ActionMessages | getMessages() | public ModuleConfig | getModuleConfig() | abstract public Map | getRequestScope() | public Map | getScope(String scopeName) | abstract public Map | getSessionScope() | protected String | getTokenGeneratorId() | public boolean | isTokenValid() | public boolean | isTokenValid(boolean reset) | public void | release() | public void | resetToken() | public void | saveActionMessages(String key, ActionMessages messages) Save the given ActionMessages into the request scope under the
given key, clearing the attribute if the messages are empty or null. | public void | saveActionMessages(String scopeId, String key, ActionMessages messages) | public void | saveErrors(ActionMessages errors) | public void | saveMessages(ActionMessages messages) | public void | saveMessages(String scope, ActionMessages messages) Adapt a legacy form of SaveMessages to the ActionContext API by
storing the ActoinMessages under the default scope. | public void | saveToken() | public void | setAction(Action action) | public void | setActionConfig(ActionConfig config) | public void | setActionForm(ActionForm form) | public void | setCancelled(Boolean cancelled) | public void | setException(Exception e) | public void | setFormValid(Boolean valid) | public void | setForwardConfig(ForwardConfig forward) | public void | setInclude(String include) | public void | setLocale(Locale locale) | public void | setLogger(Log logger) Set the commons-logging Log instance which should be
used to LOG messages. | public void | setMessageResources(MessageResources messageResources) | public void | setModuleConfig(ModuleConfig config) |
ACTION_CONFIG_KEY | final public static String ACTION_CONFIG_KEY(Code) | | |
ERROR_ACTION_MESSAGES_KEY | final public static String ERROR_ACTION_MESSAGES_KEY(Code) | | Provide the default context attribute under which to store the
ActionMessage cache for errors.
|
MESSAGE_ACTION_MESSAGES_KEY | final public static String MESSAGE_ACTION_MESSAGES_KEY(Code) | | Provide the default context attribute under which to store the
ActionMessage cache.
|
TOKEN_KEY | final public static String TOKEN_KEY(Code) | | Provide the default context attribute under which to store the token
key.
|
TRANSACTION_TOKEN_KEY | final public static String TRANSACTION_TOKEN_KEY(Code) | | Provide the default context attribute under which to store the
transaction token key.
|
ActionContextBase | public ActionContextBase(Context context)(Code) | | Instantiate ActionContextBase, wrapping the given Context.
Parameters: context - Context to wrap |
ActionContextBase | public ActionContextBase()(Code) | | Instantiate ActionContextBase, wrapping a default ContextBase
instance.
|
addActionMessages | public void addActionMessages(String key, ActionMessages messages)(Code) | | Add the given messages to a cache stored in this Context, under
key.
Parameters: key - The attribute name for the message cache Parameters: messages - The ActionMessages to add |
findOrCreateActionForm | public ActionForm findOrCreateActionForm(String formName, String scopeName) throws IllegalAccessException, InstantiationException(Code) | | Using this ActionContext 's default
ModuleConfig , return an existing ActionForm
in the specified scope, or create a new one and add it to the specified
scope.
Parameters: formName - The name attribute of our ActionForm Parameters: scopeName - The scope identier (request, session) The ActionForm for this request throws: IllegalAccessException - If object cannot be created throws: InstantiationException - If object cannot be created See Also: this.findOrCreateActionForm(String, String, ModuleConfig) |
findOrCreateActionForm | public ActionForm findOrCreateActionForm(String formName, String scopeName, ModuleConfig moduleConfig) throws IllegalAccessException, InstantiationException(Code) | | In the context of the given ModuleConfig and this
ActionContext , look for an existing
ActionForm in the specified scope. If one is found, return
it; otherwise, create a new instance, add it to that scope, and then
return it.
Parameters: formName - The name attribute of our ActionForm Parameters: scopeName - The scope identier (request, session) The ActionForm for this request throws: IllegalAccessException - If object cannot be created throws: InstantiationException - If object cannot be created throws: IllegalArgumentException - If form config is missing from moduleor scopeName is invalid |
getApplicationScope | abstract public Map getApplicationScope()(Code) | | |
getLogger | public Log getLogger()(Code) | | Provide the currently configured commons-logging Log
instance.
Log instance for this context |
getRequestScope | abstract public Map getRequestScope()(Code) | | |
getSessionScope | abstract public Map getSessionScope()(Code) | | |
getTokenGeneratorId | protected String getTokenGeneratorId()(Code) | | |
isTokenValid | public boolean isTokenValid()(Code) | | |
isTokenValid | public boolean isTokenValid(boolean reset)(Code) | | |
release | public void release()(Code) | | |
resetToken | public void resetToken()(Code) | | |
saveActionMessages | public void saveActionMessages(String key, ActionMessages messages)(Code) | | Save the given ActionMessages into the request scope under the
given key, clearing the attribute if the messages are empty or null.
Parameters: key - The attribute name for the message cache Parameters: messages - The ActionMessages to add |
saveActionMessages | public void saveActionMessages(String scopeId, String key, ActionMessages messages)(Code) | | Save the given messages into the map identified by the
given scopeId under the given key .
Parameters: scopeId - Parameters: key - Parameters: messages - |
saveMessages | public void saveMessages(String scope, ActionMessages messages)(Code) | | Adapt a legacy form of SaveMessages to the ActionContext API by
storing the ActoinMessages under the default scope.
Parameters: scope - The scope for the internal cache Parameters: messages - ActionMesssages to cache |
saveToken | public void saveToken()(Code) | | |
setLogger | public void setLogger(Log logger)(Code) | | Set the commons-logging Log instance which should be
used to LOG messages. This is initialized at instantiation time but may
be overridden. Be advised not to set the value to null, as
ActionContextBase uses the logger for some of its own
operations.
|
|
|