Package org.apache.struts.chain.commands
Class ExecuteDispatcher
java.lang.Object
org.apache.struts.chain.commands.ActionCommandBase
org.apache.struts.chain.commands.ExecuteDispatcher
- All Implemented Interfaces:
Command<ActionContext>,ActionCommand
-
Field Summary
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DispatchercreateDispatcher(String type, ActionContext context) Creates the dispatcher of the specified type.protected booleanexecute_(ActionContext context) Executes the command.final StringRetrieves the fully-qualified dispatcher class name to instantiate when an action mapping does not specify a dispatcher.protected StringgetDispatcherType(ActionContext context) Retrieves the fully-qualified class name of the dispatcher to instantiate for the specified context.protected voidprocessDispatchResult(Object result, ActionContext context) Interprets the specified dispatch result.final voidsetDefaultDispatcherType(String defaultDispatcherType) Stores the optional default dispatcher type (fully-qualified class name).Methods inherited from class org.apache.struts.chain.commands.ActionCommandBase
execute
-
Constructor Details
-
ExecuteDispatcher
public ExecuteDispatcher()
-
-
Method Details
-
createDispatcher
Creates the dispatcher of the specified type.- Parameters:
type- the dispatcher class namecontext- the current action context- Returns:
- the dispatcher
- Throws:
Exception- if creation fails- See Also:
-
execute_
Description copied from class:ActionCommandBaseExecutes the command.- Specified by:
execute_in classActionCommandBase- Parameters:
context- TheContextfor the current request- Returns:
- TRUE if processing should halt
- Throws:
Exception- On any error
-
getDefaultDispatcherType
Retrieves the fully-qualified dispatcher class name to instantiate when an action mapping does not specify a dispatcher.- Returns:
- the default dispatcher type (fully-qualified class name)
- See Also:
-
getDispatcherType
Retrieves the fully-qualified class name of the dispatcher to instantiate for the specified context.- Parameters:
context- the current action context- Returns:
- the class name or
null - See Also:
-
processDispatchResult
Interprets the specified dispatch result. Subclasses should override this method to provide custom result type handling. Four handlings are automatically provided:nulltype means the response was handled directly, and therefore no extra processing is performForwardConfigtype is the classical response, and will be stored in the contextStringtype represents the name of a required forward to lookup, and will be stored in the contextVoidtype means the method had no return signature, and select theAction.SUCCESSaction forward and store in the context
- Parameters:
result- the result valuecontext- the current action context- Throws:
IllegalStateException- if unknown result type or the forward cannot be found- See Also:
-
setDefaultDispatcherType
Stores the optional default dispatcher type (fully-qualified class name).- Parameters:
defaultDispatcherType- the dispatcher type ornull- See Also:
-