I recently came to the conclusion that I didn't like the hidden form field
markers and conditional logic used in the Action.execute() method, to
determine whether the user was performing the initial fetch of an
ActionMapping or submitting.  The solution I came up with was to extend the
Struts RequestProcessor's processActionPerform() method, to parse the
request uri of the ActionMapping, to determine which (new) method to call on
the Action (doSelect or doSubmit).  Obviously this forces a naming
convention for the value of the ActionMapping path attributes
(path="/myAction/select" and path="/myAction/submit").  I then extended
Action, to define these as abstract methods.  I found that this seemed very
natural, reduced code bloat and made a clear distinction between disparate
request types.  I'm wondering if anyone else has done something different
and/or more practical.

Reply via email to