Apache web server - hierarchy in Figure 11-1, there are two versions
hierarchy in Figure 11-1, there are two versions of ValidatorForm. The parent class is called ValidatorForm, or DynaValidatorForm for the dynamic branch. Each of these has a subclass that contains the name Action in its title. The subclass of the ValidatorForm is called ValidatorActionForm , and the subclass of the DynaValidatorForm is called DynaValidatorActionForm . The purpose of the two different versions is to allow you to associate the validation with the form-bean definition or the action definition. The ValidatorActionFormand DynaValidatorActionForm classes pass the path attribute from the action element into the Validator, and the Validator uses the action’s name to look up the validation rules. If you use the ValidatorFormor DynaValidatorForm, the name of the ActionForm is used to look up the set of validation rules to use. The only reason for using one or the other is to have more fine-grained control over which validation rules are executed. For example, suppose that an ActionForm contains three different validation rules, but only two of them should get executed for a particular action. You could configure the rules to perform only the subset of validation rules when that action gets invoked. Otherwise, all of the rules would be invoked. In general, using ValidatorFormor DynaValidatorForm should be sufficient for your needs. Let’s look at a more complete example of using the Validator framework. As in previous chapters, we’ll employ the Storefront application to help us understand the Validator better. In particular, we’ll look at the HTML form used to capture the shipping information during checkout of the Storefront application. This is shown in Figure 11-2. Figure 11-2. Capturing the shipping address information
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.