DynaValidatorActionForm is used when you want field validation
on a per action mapping basis as opposed to a form name basis.
For example, let's say I have a single form used across a wizard
style process. In steps 1 and 2, I want to validate fields A-D,
and in steps 3-6 validate fields E-T. You can do this by using
the DynaValidatorActionForm and demarcating your field validation
by putting the appropriate action path in the name attribute of
the form element of the validation.xml file.

HTH,

robert

-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 02, 2003 3:24 PM
To: 'Struts Users Mailing List'
Subject: RE: dyna classes


riyaz wrote:
> just to give an example; reading the docs, i could not see a difference
> between DynaValidatorForm and DynaValidatorActionForm in the validator
> package.

I just looked at the source code.  (A highly recommended activity!)
DynaValidatorActionForm extends from DynaValidatorForm, and it overrides
'validate' but the only difference is on one line of code.

DynaValidatorForm has:
Validator validator =
            Resources.initValidator(mapping.getAttribute(), this,
application, request, errors, page);

DynaValidatorActionForm has:
        Validator validator =
            Resources.initValidator(mapping.getPath(), this, application,
request, errors, page);

The difference appears to be that one uses the 'attribute' (which is the
<action> tag's 'name' parameter) and the other uses the <action> tag's
'path' parameter when the validator is initialized.

So what is DynaValidatorActionForm for?  When would you use one or the
other?

> docs aside, a good sample application that uses the new features 
> would be fine too.

The struts-example webapp uses a DynaValidatorForm, but it only has two
simple String properties.  That should get you started.  I'm still looking
for an example of a DynaValidatorForm with indexed properties... I can only
find examples with plain old Action Forms.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to