• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ValidatorActionForm example

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help me understand the difference between ValidatorForm and the ValidatorActionForm. Real time scenario to use ValidatorActionForm.

Please give some example code, which will help me understand in a better way.

Thanks in advance.
Wrushasen D.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

Even I would like to have some examples on that. Does anyone know about the online resources available that teaches us with examples on such frameworks?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The best source of information for a question like this is the Struts Javadoc. Just look up both the ValidatorForm and the ValidatorActionForm classes and read the overview material. You can find the Struts Javadoc by first going to the Struts 1 home page and then clicking the Javadoc link in the left navigation bar.

The Struts Validator Guide is another good source of information. Here's a quote from it:

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).

 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Merril!
 
reply
    Bookmark Topic Watch Topic
  • New Topic