you don't need 2 action classes.
you may declare 2 actions in the struts-config.xml file using the same
class.
but you have to declare 2 formset tags in the validation.xml file,
setting up each form name with the action path instead of the form name.

in the first formset tag you define validation rules for all the fields
and in the second you do it only for a part of them.

using the first action will validate all the fields and using the second
will validate only a part of them.

thomas

> -----Original Message-----
> From: Trent Fisher [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 25, 2003 4:05 PM
> To: [EMAIL PROTECTED]
> Subject: Re: RE : Validator and Dispatch Actions
> 
> 
> This being the case, say you had a situation where your form 
> had a few 
> fields that would be disabled/not displayed if a user didnt 
> have a certain 
> access level.
> 
> If you wanted 2 separate validation schemes for this form 
> (one that has all 
> fields being validated, one that has all fields except for 
> the "disabled/not 
> shown" fields being validated) then you would need 2 action 
> classes (or 2 
> dispatch methods in the case below)?  If the actions will be 
> executing 
> similar, if not identical code based on the fields submitted, 
> this seems 
> like an awful lot of rework just to get the validation accomplished.
> 
> 
> 
> 
> >From: "thomas Sontheimer" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" 
> <[EMAIL PROTECTED]>
> >To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> >Subject: RE : Validator and Dispatch Actions
> >Date: Mon, 25 Aug 2003 15:21:47 +0200
> >
> >you have to use (Dyna)ValitatorActionForm instead of 
> >(Dyna)ValidatorForm. Then in your validation.xml file for 
> each new rule 
> >you specify you have to replace the name of the form by the 
> name of the 
> >action using the form. And the rule will be applied to the 
> form only if 
> >it's called from the action you gave the name.
> >In your case you have to specify 1 form, 3 actions and 3 rules.
> >
> >thomas
> >
> > > -----Original Message-----
> > > From: manglu [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 26, 2003 1:33 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Validator and Dispatch Actions
> > >
> > >
> > > Hi,
> > >
> > > I want to use the Struts Validator to do validation.
> > >
> > >
> > > The Same action form is used for SEARCH, CREATE and EDIT.
> > >
> > > The validation rules for each of them is different( from 
> the other 
> > > two)
> > >
> > > How do i go about defining such a config in the validation config 
> > > file.
> > >
> > > Appreciate any help.
> > > TIA
> > > Manglu
> > >
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: 
> [EMAIL PROTECTED]
> > >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> _________________________________________________________________
> MSN 8: Get 6 months for $9.95/month 
> http://join.msn.com/?page=dept/dialup
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to