Class AbstractParameterDispatcher

java.lang.Object
org.apache.struts.dispatcher.AbstractDispatcher
org.apache.struts.dispatcher.AbstractParameterDispatcher
All Implemented Interfaces:
Serializable, Dispatcher
Direct Known Subclasses:
ServletParameterDispatcher

public abstract class AbstractParameterDispatcher extends AbstractDispatcher
This abstract class is a template for choosing the target method that is identified by a submission parameter.
Since:
Struts 1.4
Version:
$Rev$
See Also:
  • Field Details

  • Constructor Details

    • AbstractParameterDispatcher

      public AbstractParameterDispatcher(MethodResolver methodResolver)
      Constructs a new dispatcher with the specified method resolver.
      Parameters:
      methodResolver - the method resolver
  • Method Details

    • getDefaultParameterName

      protected String getDefaultParameterName()
      Retrieves the name of the parameter to fallback upon if the action configuration did not set the parameter attribute. The default implementation returns DEFAULT_PARAMETER_NAME.
      Returns:
      the fallback parameter name; can be null
      See Also:
    • getParameter

      protected String getParameter(ActionContext context)
      Retrieves the parameter name whose value will identity the intended method to dispatch. The value is not necessarily a method name, but a key that can resolve to one. The default implementation returns the mapping's parameter attribute; otherwise fallback to the default parameter name.
      Parameters:
      context - the current action context
      Returns:
      the mapping's parameter name
      See Also:
    • resolveMethodName

      protected final String resolveMethodName(ActionContext context)
    • resolveParameterValue

      protected abstract String resolveParameterValue(ActionContext context, String parameter)
      Extracts the value that is keyed by the specified parameter.
      Parameters:
      context - the current action context
      parameter - the parameter name
      Returns:
      the parameter value