Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.3.0
-
None
-
None
-
Operating System: other
Platform: Other
-
38343
Description
The attached ParameterMappingDispatchAction class is a proposed enhancement to
MappingDispatchAction either as a subclass or a direct replacement. Here are the
added benefits:
1) For a form with multiple buttons, the parameter attribute can contain a list
of appropriate methods to iterate for a match. These methods are matched against
incoming request parameters (as well as button .x/.y suffixes). For security
reasons, a developer may want to limit which methods to invoke for a particular
mapping, unlike DispatchAction which will match any existing method.
<action ... parameter="save,apply,back"/>
2) ParameterMappingDispatchAction provided the ability to also obfuscate method
names, and so does this by providing a key=value mapping. The key will be the
request parameter name and the value the method name.
<action ... parameter="save,apply=saveAndReturn,back=goBack"/>
3) Sometimes the user presses Enter to submit the form and no button is
explicitly submitted. When this case is important to catch, the action may
invoke the "default" method if nothing matches. In this example, the default is
to save.
<action ... parameter="save,apply,back,default=save"/>
4) When only one method is listed, the method returns it to equal functionality
to MappingDispatchAction.
<action ... parameter="save"/>