wood burning stoves 2.0*
The moose likes Struts and the fly likes Validation in sturts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validation in sturts" Watch "Validation in sturts" New topic
Author

Validation in sturts

Ad Rajesh
Greenhorn

Joined: Apr 25, 2006
Posts: 21
How can we perform validation for a field which hold three condition.
Condition: field1 should be 0 or between 100-200.
How can we perform validation for this situation.


SCJP 1.4
SCWCD 5.0
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Struts validation framework was designed to handle only basic, simple validations. Once you get into more complex scenarios, you generally have to write your own validation logic, either by extending the validate method of your ActionForm (you can still call super.validate() to have the rest of the framework validations performed), or by writing a custom validation rule.

Having said that,you might be able to use the validWhen rule for this. See the section entitled Designing Complex Validations with ValidWhen in this link.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validation in sturts
 
Similar Threads
XML validation checks on String
struts action form
Struts 1.2 - Client and Server-side validations
serverside validation
Validation in LazyDynaBean