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/"). 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.

  • No labels