• Post Reply Bookmark Topic Watch Topic
  • New Topic

validation in struts

 
hari krishnan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends


can anyone explain the difference between using ActionForm validate() method and validation.xml,when these two methods are in demand.



Thank you
 
Sahid Khan
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

validation.xml comes with struts validator framework. It gives you certain set of validation rules, which you can use conveniently from xml files. But with ActionForm validate method you need to write your validation rules programmatically. So I think validator framework makes it more convenient for you.
 
purushottaman dwarkanathan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
validation.xml will take care of the validation for common fields that can appear in a form and also based on the data types that is involved.

Normally since we are going for DynaActionForms these days, we do not need any implementation of the validate method.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!