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

 

[EMAIL PROTECTED]

Voice: (310) 470-1257

Fax:    (310) 362-8454

 

Sun Microsystems iForce Partner


-----Original Message-----
From: Ellingson, David [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 15, 2004 1:50 PM
To: '[EMAIL PROTECTED]'
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: [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