Using an ActionForm with the Validator
You can’t use the standard Struts
class with the Validator. Instead, you
need to use a subclass of the
that is specifically designed to work with the Validator framework.
There are two root subclasses to select from, depending on whether
you are planning to use dynamic
ActionForms. Figure 11-1 shows the
its descendants, to help you visualize the hierarchy.
Figure 11-1. The ActionForm class hierarchy
If you are using dynamic
ActionForms, you should
branch of the hierarchy. If you are using standard
ActionForms, you can use the
or one of its descendants instead.
Whether you use dynamic or regular
the manner in which you configure the Validator is the same. Just be
sure that whichever
ActionForm subclass you
choose, you configure the
form-bean section of the
Struts configuration file using the fully qualified class name. See
Section 188.8.131.52 for more details.
Dynamic or standard is only the first decision that you have to make
when choosing the proper
Notice that in both the dynamic and standard branch of the
ActionForm hierarchy in Figure 11-1, there are two versions of
ValidatorForm. The parent class is called
DynaValidatorForm for the dynamic branch.
Each of these has a subclass that contains the name ...