• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Diiference between the Validator

 
rex tony
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic