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

public class ExecuteDispatcher extends ActionCommandBase
  • Constructor Details

    • ExecuteDispatcher

      public ExecuteDispatcher()
  • Method Details

    • createDispatcher

      protected Dispatcher createDispatcher(String type, ActionContext context) throws Exception
      Creates the dispatcher of the specified type.
      Parameters:
      type - the dispatcher class name
      context - the current action context
      Returns:
      the dispatcher
      Throws:
      Exception - if creation fails
      See Also:
    • execute_

      protected boolean execute_(ActionContext context) throws Exception
      Description copied from class: ActionCommandBase
      Executes the command.
      Specified by:
      execute_ in class ActionCommandBase
      Parameters:
      context - The Context for the current request
      Returns:
      TRUE if processing should halt
      Throws:
      Exception - On any error
    • getDefaultDispatcherType

      public final String 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

      protected String getDispatcherType(ActionContext context)
      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

      protected void processDispatchResult(Object result, ActionContext context)
      Interprets the specified dispatch result. Subclasses should override this method to provide custom result type handling. Four handlings are automatically provided:
      1. null type means the response was handled directly, and therefore no extra processing is perform
      2. ForwardConfig type is the classical response, and will be stored in the context
      3. String type represents the name of a required forward to lookup, and will be stored in the context
      4. Void type means the method had no return signature, and select the Action.SUCCESS action forward and store in the context
      Parameters:
      result - the result value
      context - the current action context
      Throws:
      IllegalStateException - if unknown result type or the forward cannot be found
      See Also:
    • setDefaultDispatcherType

      public final void setDefaultDispatcherType(String defaultDispatcherType)
      Stores the optional default dispatcher type (fully-qualified class name).
      Parameters:
      defaultDispatcherType - the dispatcher type or null
      See Also: