struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Ferguson <William.Fergu...@hubbub.com.au>
Subject RE: Using 1 Validator definition for 2 different forms?
Date Wed, 30 Jun 2004 02:20:36 GMT
You're right.

My pet hate of the validation framework - validation should be configured on
the ActionConfig instead of via the ActionConfig#path. This would provide
for Mick's requirements. It would also free Strus Forms from having to
extend from ValidatorForm or ValidatorActionForm in order to get some
validation.

William

-----Original Message-----
From: Joe Hertz [mailto:jhertz@speakeasy.net]
Sent: Wednesday, 30 June 2004 12:14 PM
To: 'Struts Users Mailing List'
Subject: RE: Using 1 Validator definition for 2 different forms?


Using ValidatorActionForm would result in the Validator being pointed at
Actions and not forms. I don't see how that gets one validator
definition...

Let me ask this of Mick:

Why you using two different form definitions? If they are identical,
what are you hoping to accomplish by defining it twice? 

If you had two different actions using it, why wouldn't you just reuse
one form bean definition for both of them? If that's the case, then one
ValidatorForm entry in the validator is all you'd need. Of course, this
ties the processing together and re-sundering it may be an issue later.
Don't know how wise or unwise it would be in your case.

I suspect there may be a way of getting around the problem, but I can't
see it from here.



> -----Original Message-----
> From: William Ferguson [mailto:William.Ferguson@hubbub.com.au] 
> Sent: Tuesday, June 29, 2004 10:01 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Using 1 Validator definition for 2 different forms?
> 
> 
> Try extending from ValidatorActionForm instead of ValidatorForm.
> 
> -----Original Message-----
> From: Jim Barrows [mailto:jbarrows@sssc.com]
> Sent: Wednesday, 30 June 2004 5:37 AM
> To: Struts Users Mailing List
> Subject: RE: Using 1 Validator definition for 2 different forms?
> 
> 
> > -----Original Message-----
> > From: Mick.Knutson@wellsfargo.com 
> [mailto:Mick.Knutson@wellsfargo.com]
> > Sent: Tuesday, June 29, 2004 12:28 PM
> > To: user@struts.apache.org
> > Subject: RE: Using 1 Validator definition for 2 different forms?
> > 
> > 
> > No, I mean I have a user1Form, and user2Form.
> > They are identical forms as we are using Tiles to display them.
> 
> Validator validates on form name... if they are the same form (ie same
> class) and different names,
> I don't think you can with 1.1.  If you're using tiles to 
> display the same form, in 2+ different places on the same jsp 
> page, you don't necessarily have to have seperate form names 
> for each ( javascript may have issues with this though, I 
> don't do enough javascript to know).
> 
> You might want to look at how ValidatorForms validate method 
> works, and override it in your forms to look 
> at the correct validation name.   That's a bit of a hack though.
> 
> > 
> > 
> > -----Original Message-----
> > From: Jim Barrows [mailto:jbarrows@sssc.com]
> > Sent: Tuesday, June 29, 2004 12:21 PM
> > To: Struts Users Mailing List
> > Subject: RE: Using 1 Validator definition for 2 different forms?
> > 
> > 
> > If you're talking about masks, then you can use globals.  You
> > could also
> > create your own custom validator, iirc 1.2 will have some 
> inheritance
> > features, but not sure what scope yet since I'm not using 1.2.
> > 
> > 
> > > -----Original Message-----
> > > From: Mick.Knutson@wellsfargo.com
> > [mailto:Mick.Knutson@wellsfargo.com]
> > > Sent: Tuesday, June 29, 2004 12:12 PM
> > > To: user@struts.apache.org
> > > Subject: Using 1 Validator definition for 2 different forms?
> > > 
> > > 
> > > How can I Use 1 Validator definition for 2 different forms?
> > > 
> > > 
> > > ---
> > > > Thanks...
> > > > Mick Knutson
> > > > 
> > > > 525 Market Street, SF, CA  94103
> > > > (415) 222-1020
> > > > Mick.Knutson@WellsFargo.com
> > > > MAC A0103-223
> > > ---
> > > 
> > > 
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > 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
> > 
> > 
> 
> ---------------------------------------------------------------------
> 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

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


Mime
View raw message