Virtual web hosting - The typeattribute specifies the exact ActionFormsubclass. In early

The typeattribute specifies the exact ActionFormsubclass. In early beta releases of Struts 1.1, the form-bean section required that you set the dynamic attribute to true when using dynamic ActionForms. This is no longer necessary, as the framework will determine whether the class specified in the type attribute is a descendant of the DynaActionForm class. The next step is to edit the application-specific validation logic, which is done in the validation.xml file. You must declare a validation rule for each property in the form that you need to validate. In some cases, you might need to specify multiple rules. In Figure 11-2, for example, the phonefield is required, and it must fit a specific format. These are two separate rules that both must evaluate to true, or the validation for the form will fail. The entire validation.xml file is not shown because it’s too large and most of it is redundant. The section shown in Example 11-2 will help you understand how things are connected. Example 11-2. A sample validation.xml file for the checkout form
phone ^(?(d{3}))?[-| ]?(d{3})[ | ]?(d{4})$ zip ^d{5}(-d{4})?$

mask ^[a-zA-Z]*$ mask ${zip} Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Leave a Reply