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:
org.apache.commons.chain.Command<ActionContext>
,ActionCommand
-
Field Summary
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Dispatcher
createDispatcher
(String type, ActionContext context) Creates the dispatcher of the specified type.protected boolean
execute_
(ActionContext context) Executes the command.final String
Retrieves the fully-qualified dispatcher class name to instantiate when an action mapping does not specify a dispatcher.protected String
getDispatcherType
(ActionContext context) Retrieves the fully-qualified class name of the dispatcher to instantiate for the specified context.protected void
processDispatchResult
(Object result, ActionContext context) Interprets the specified dispatch result.final void
setDefaultDispatcherType
(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:ActionCommandBase
Executes the command.- Specified by:
execute_
in classActionCommandBase
- Parameters:
context
- TheContext
for 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:null
type means the response was handled directly, and therefore no extra processing is performForwardConfig
type is the classical response, and will be stored in the contextString
type represents the name of a required forward to lookup, and will be stored in the contextVoid
type means the method had no return signature, and select theAction.SUCCESS
action 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:
-