Using a single ActionForm throughout your application can reduce
maintenance. Each property only needs to be defined once even if it
appears on several different forms. In larger applications, many forms
represent a join between several tables and the same properties appear
and reappear on various forms. An ActionForm can easily represent the
join between all the properties used by all the forms in your
application. 

The one ActionForm class can be cast as several different form-beans,
usually one for each distinct form. This will give the object its own
attribute name in the request (or session), so there is not a conflict
should there be more than one form on a page. 

The Struts Validator goes by the attribute name, not the class, so you
can have a distinct validation for each form-bean. 

If you are not using the Struts Validator, then you can define a base
ActionForm with all your properties, and then subclass the base class
with whatever validations are needed.

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


Radhika Nadkarni wrote:
> 
> hi,
> Wat r the disadv. of using multiple form beans in case u have diff. JSPs ?
> Also, wat r thr adv. of using a single form bean in the case of diff. JSPs ?
> 
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

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

Reply via email to