jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes struts2 validation with conditions! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 validation with conditions!" Watch "struts2 validation with conditions!" New topic
Author

struts2 validation with conditions!

Bhaarat Sharma
Ranch Hand

Joined: Jun 04, 2007
Posts: 96
Hello,

I am submitting a form to the action class. In the action class I need to do some validation. But the validation needs to be done if some conditions are true. there are different validation errors for different fields.

so lets say if i have this in my action class

this will do validation whenever the 'enter date field is empty'. But what If I wanted to do this if and only if method isTrue() returns true? how would i do that??

Will I have to write my custom validator just for this?

appreciate all the help!


omnipresent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts2 validation with conditions!
 
Similar Threads
struts2 workflow question
Validation Problem
On mysterious error returned to login page?
Bizarre problem with validation in Struts 2
Validation and copying