struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@blueyonder.co.uk>
Subject Re: LookupDispatchAction and Form validation + DispatchAction
Date Wed, 16 Jun 2004 01:40:29 GMT
DynaValidatorForm has been refactored slightly to make it easier to override
the key to use for the validator plugin (available in the nightlies and will
be in next release of Struts). If you extend DynaValidatorForm and override
the getValidationKey() method maybe you could use combination of the form
and method name for the validator plugin rules.

For an example of this look at DynaValidatorActionForm:

http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/struts/validator/

Niall

----- Original Message ----- 
From: "Josh Holtzman" <jholtzman@americandatacompany.com>
To: "'Struts Users Mailing List'" <user@struts.apache.org>
Sent: Tuesday, June 15, 2004 10:18 PM
Subject: RE: LookupDispatchAction and Form validation + DispatchAction


> David,
>
> I too am having a similar concern, albeit, with the DispatchAction class.
>
> I am currently have a form that is backed by a DynaActionForm and
validation
> occurs through the Validator pluggin.
>
> When binding the validation routine to the action by specifying
> "validate='true'" in my Action configuration (within the struts-config.xml
> file) I believe it will run my validation against all methods called
within
> the DispatchAction class for this action.  In my situation, I only want
the
> validation to be performed on 2 of the 6 methods within my DispatchAction
> class.
>
> Is there a way to do this while still using the Validator Pluggin and a
> DynaActionForm?
>
> Here are some alternatives I have devised:
> 1.  Create 1 DispatchAction class to handle the two methods with
validation,
> and 1 for all other methods.
>
> 2.  Do not use the Validator pluggin, and perform validation within the
> DispatchAction class only when the specific methods are called.
>
> I don't like either of these options very much (particularly number 2)
since
> they require a significant increase in maintenance.
>
> Any suggestions would be greatly appreciated.
>
> Thanks.
>
>
> Josh Holtzman
>
>
>
>
>
>
>
> AMERICAN DATA COMPANY
>
> Developing and Supporting your Online Applications
>
>
>
> jholtzman@americandatacompany.com
>
> Voice: (310) 470-1257
>
> Fax:    (310) 362-8454
>
>
>
> Sun Microsystems iForce Partner
>
>
> -----Original Message-----
> From: Ellingson, David [mailto:David.Ellingson@NielsenMedia.com]
> Sent: Tuesday, June 15, 2004 1:50 PM
> To: 'user@struts.apache.org'
> Subject: LookupDispatchAction and Form validation
>
> I am trying to implement a LookupDispatchAction class, and I'm not sure if
> I'm trying to use Form validation in an unintended manner.
>
> I see that the LookupDispatchAction class is designed to handle multiple
> methods, but I do not see a corresponding way to handle multiple
> validations.  As the value of the "parameter" attribute is available from
> within the ActionForm.validate() method , it seems like I could somehow
use
> this to determine how to validate the form.  However, that would require
me
> to hardcode against the value from the html page/Resource file.
>
> 1)  Is there a way to perform validation based on the method being
> performed?
> 2)  If not, is there a reason for this restriction?
> 3)  Am I supposed to create separate Action and Form classes in this
> situation?
>
>
> Thanks,
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message