File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes validation in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validation in struts" Watch "validation in struts" New topic

validation in struts

hari krishnan

Joined: Jul 27, 2007
Posts: 4
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

Joined: Jun 27, 2007
Posts: 41

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

Joined: Apr 26, 2005
Posts: 25
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.

IBM Certified SOA Associate
I agree. Here's the link:
subject: validation in struts
It's not a secret anymore!