Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Validation

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One simple question - if my form bean is of the
DynaValidatorForm type in the struts-config.xml and
each propery of the form is specified in the
validation.xml, do I have to call the validate method
in the form bean? E.g. Do I still have to do the
following in my form bean that extends the ActionForm?
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


do I have to call the validate method in the form bean?


No. A struts validator is going to manage input validation for you.

Do I still have to do the following in my form bean that extends the ActionForm?


No. But if you want to use validate method in the form bean with the defined validators, your ActionErrors object under the validate method should invoke super.validate(mapping, request).
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The whole idea of having the DynaValidatorForm (sp?) as your FormBean instead of an ActionForm is so that you can manage all your validation requirements declaratively.
In the end, all validation is done either with the built-in validation functions, or custom ones if your application needs something additional that doesn't come out-of-the-box.
So, there's no source file for you to maintain (other than your struts-config.xml and whereever the validator functions are declared).
 
Won't you please? Please won't you be my neighbor? - Fred Rogers. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic