Thanks gentlemen. 

This solves the problem for different validation rules for the same form,
but I still need to figure how to get information from the backend that the
form doesn't store.  For example each form has a section on user input,
which will be populated with user info if validation fails.  However, below
that section is an area that holds readonly information that is retrieved
from backend services, so I need to retrieve this again unless I store it in
the session, which I hesitate to do.  So even though I can specify which
rules apply to the same form, I cannot specify which initialization code to
use when validation fails.


-----Original Message-----
From: Blake Whitmore [mailto:[EMAIL PROTECTED]
Sent: Friday, March 19, 2004 9:50 AM
To: Struts Users Mailing List
Subject: Re: Can coarse grained ActionForms validate?


Hi Jim,

You can specify multiple form bean mappings per action
form.  For insance:

<form-bean name="registrationForm"
           type="com.pkg.MyFormBean"/>

<form-bean name="otherForm"
           type="com.pkg.MyFormBean"/>

Then, in your validation.xml, you can have different
rules for both of those forms. 

HTH,
Blake







--- "Chan, Jim" <[EMAIL PROTECTED]> wrote:
> 
> 
> Hi, I am using coarse grained action forms that are
> re-used by various
> action classes.  Each of these action classes serve
> a different page and
> retrieves information from the backend so that the
> jsp page can show it.
> Now because I am using coarse grained forms, I have
> now way of knowing which
> fields to validate because the same form serve
> multiple actions.  Also, if I
> use the ActionForm class to validate the client
> data, the ActionForm has to
> be responsible for re-initializing that page with
> backend information if
> validation fails.  Therefore, even if I change to
> very fine-grained
> DynaForms and use the validation framework so that
> each action maps to one
> form, I will probably have to figure some way of
> fetching backend
> information if validation fails.
> 
> Currently, I am doing all the client input
> validation in the action classes
> because it seems to be the most simple solution;
> however, it has the caveat
> that the action class is now responsible for both
> validation and backend
> service delegation.  I am just wondering if there is
> a more elegant solution
> using the action forms as the validator.
> 
> Any help is greatly appreciated.
> 


__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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

Reply via email to