File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Diiference between the Validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Diiference between the Validator" Watch "Diiference between the Validator" New topic
Author

Diiference between the Validator

rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
I think this is the basic difference between DynaValidatorActionForm and DynaValidatorForm,Is there any other differences?Give an elaborate note

DynaValidatorActionForm
struts-config.xml ,action mapping -> path <-> validation.xml,name

DynaValidatorForm
struts-config.xml ,action mapping -> name <-> validation.xml,name
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The difference between DynaValidatorActionForm and DynaValidatorForm is the same as the difference between ValidatorActionForm and ValidatorForm. The usage of each is explained in the Struts Validator Guide

Once you have configured the Validator Plug-In, so that it can load your Validator Resources you just have to extend org.apache.struts.validator.action.ValidatorForm instead of org.apache.struts.action.ActionForm . Then when the validate method is called, the action's name attribute from the Struts Configuration is used to load the validations for the current form. The form element's name attribute in the Validator configuration should match the action element's name attribute.

An alternative approach is to use the action mapping path attribute. In this case, you extend the ValidatorActionForm instead of the ValidatorForm. The ValidatorActionForm uses the action element's path attribute from the Struts configuration which should match the form element's name attribute in the Validator configuration.

Then a separate action mapping can be defined for each page in a multi-page form, and the validation form can be associated with the action rather than a page number (as shown in the example of a multi-page form in the validator example).


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Diiference between the Validator