You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/01/24 18:45:19 UTC

DO NOT REPLY [Bug 16401] New: - ValidatorLookupDispatchAction

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16401>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16401

ValidatorLookupDispatchAction

           Summary: ValidatorLookupDispatchAction
           Product: Struts
           Version: Nightly Build
          Platform: All
               URL: http://www.phase.ws/struts/
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Standard Actions
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: mail@phase.ws


I just put together a class that uses the Validator from within a
LookupDispatchAction. The class could be easily included into the Struts
distribution. It is very useful to have the validation available to call
from within the DispatchAction because different methods require different
validation. Anyways, I have heard others speak of Action based validation
(Craig included). This is not as useful in regular actions because the
mapping allows for the flexibility. But for those of us who use the
Dispatch... this type of validation is uesful. The code should be ready to
drop in with no changes.

FYI - The class extends DispatchAction and uses the same code as the
LookupDispatchAction. I took the validation code from the
ValidatorActionForm and included it in the ValidatorLookupDispatchAction
class with some minor changes.

I also, abstracted the method lookup process into a method 
called "lookupMethod". This allows for the method name to be retrieved from 
within the extended ValidatorLookupDispatchAction class for other purposes or 
custom configurations that might be used.

Basically, the key that is looked up in the validation.xml form name is the
ActionMapping url plus a dot method name. (.i.e. /myAction.do.edit <- edit
is the method name).

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>