Differences between revisions 2 and 3
Revision 2 as of 2005-03-22 05:48:36
Size: 2767
Editor: anonymous
Comment: missing edit-log entry for this revision
Revision 3 as of 2009-09-20 23:12:35
Size: 2783
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
The [http://struts.apache.org/api/org/apache/struts/action/ActionForm.html 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. The [[http://struts.apache.org/api/org/apache/struts/action/ActionForm.html|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.
Line 3: Line 3:
[http://struts.apache.org/api/org/apache/struts/validator/ValidatorForm.html 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. [[http://struts.apache.org/api/org/apache/struts/validator/ValidatorForm.html|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.
Line 5: Line 5:
[http://struts.apache.org/api/org/apache/struts/validator/ValidatorActionForm.html 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. [[http://struts.apache.org/api/org/apache/struts/validator/ValidatorActionForm.html|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.
Line 7: Line 7:
[http://struts.apache.org/api/org/apache/struts/validator/BeanValidatorForm.html BeanValidatorForm] is a 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, and optionally validated through the Validator plugin. [[http://struts.apache.org/api/org/apache/struts/validator/BeanValidatorForm.html|BeanValidatorForm]] is a 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, and optionally validated through the Validator plugin.
Line 9: Line 9:
[http://struts.apache.org/api/org/apache/struts/action/DynaActionForm.html 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. [[http://struts.apache.org/api/org/apache/struts/action/DynaActionForm.html|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.
Line 11: Line 11:
[http://struts.apache.org/api/org/apache/struts/validator/DynaValidatorForm.html DynaValidatorForm] and [http://struts.apache.org/api/org/apache/struts/validator/DynaValidatorActionForm.html 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. [[http://struts.apache.org/api/org/apache/struts/validator/DynaValidatorForm.html|DynaValidatorForm]] and [[http://struts.apache.org/api/org/apache/struts/validator/DynaValidatorActionForm.html|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.
Line 13: Line 13:
[http://struts.apache.org/api/org/apache/struts/validator/LazyValidatorForm.html 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. [[http://struts.apache.org/api/org/apache/struts/validator/LazyValidatorForm.html|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.

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 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, and optionally validated through the Validator plugin.

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.

StrutsFormBeans (last edited 2009-09-20 23:12:35 by localhost)