Date: 2005-01-11T16:21:29
   Editor: HubertRabago
   Wiki: Apache Struts Wiki
   Page: StrutsFormBeans
   URL: http://wiki.apache.org/struts/StrutsFormBeans

   Initial text for page describing the different form beans.   Will refine 
later.

New Page:

The ActionForm is the base class for all Struts form beans.  These are used to 
hold the values passed from the browser.  These values can come from a <form>, 
from multiple <form>s through multiple pages, or even from parameters at the 
end of a URL (like "/webapp/path.do?fname=Jane&lname=Doe").  Typical subclasses 
will define String fields with accessors that will be called when Struts draws 
a form or processes a submitted form.  It provides methods that can be 
overridden for resetting values or validating values.

ValidatorForm is an special ActionForm that is used with the Validator plugin.  
This is subclasses similar to the ActionForm, but the validation can be 
configured externally, allowing the use of standard validators (and/or the 
reuse of custom ones).  The Validator plugin identifies the rules to use for a 
given form using the form's name.

ValidatorActionForm is a variant of ValidatorForm.  The Validator plugin will 
find the set of rules to apply to it based on which path it gets submitted to.

BeanValidatorForm is a new form bean which can be backed by a POJO or a dyna 
bean.   Through this class, you can use your own business object to back a form 
bean.  I believe this will work better if you're using 1.2.5 or higher.  ( 
http://marc.theaimsgroup.com/?l=struts-user&m=109189534517819&w=2 & 
http://marc.theaimsgroup.com/?l=struts-user&m=109189531927171&w=2 )

DynaActionForm is a dyna form, or a form bean that can be used without creating 
subclasses.  Instead, its fields are specified through the struts configuration 
file.  These are intended for simpler forms which do not need validation.

DynaValidatorForm and DynaValidatorActionForm are both dyna forms that are 
supported by the Validator plugin.  You specify their fields through the struts 
configuration file, and validation rules through Validator.  For 
DynaValidatorForm, Validator will look for validation rules by matching the 
form name.  For DynaValidatorActionForm, Validator will apply rules according 
to what path the form is being submitted to.

LazyValidatorForm is a dyna form that doesn't need to have its fields specified 
in a config file.  You can declare a bean to be a LazyValidatorForm and it'll 
create the necessary fields as values are passed to it.


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

Reply via email to