Class AbstractEventMappingDispatcher

All Implemented Interfaces:
Serializable, Dispatcher
Direct Known Subclasses:
ServletEventMappingDispatcher

public abstract class AbstractEventMappingDispatcher extends AbstractMappingDispatcher
This abstract class is a template for choosing the target method that is named in the list-encoded parameter attribute of the ActionMapping that matches a submission parameter. This is useful for developers who prefer to use many submit buttons, images, or submit links on a single form and whose related actions exist in a single action.

For utility purposes, you can use the key=value notation to alias methods so that they are exposed as different form element names, in the event of a naming conflict or otherwise. In this example, the recalc button (via a submission parameter) will invoke the recalculate method. The security-minded person may find this feature valuable to obfuscate and not expose the methods.

The default key is purely optional, but encouraged when nothing matches (such as the user pressing the enter key). If this is not specified and no parameters match the list of method keys, the method resolution returns null.

The order of the parameters are guaranteed to be iterated in the order specified. If multiple buttons were accidently submitted, the first match in the list will be dispatched.

Since:
Struts 1.4
Version:
$Rev$
See Also:
  • Field Details

    • DEFAULT_METHOD_KEY

      protected static final String DEFAULT_METHOD_KEY
      The method key, if present, to use if other specified method keys do not match a request parameter.
      See Also:
  • Constructor Details

    • AbstractEventMappingDispatcher

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