jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes Validation question 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 "Validation question" Watch "Validation question" New topic
Author

Validation question

Jim Patrick
Ranch Hand

Joined: Dec 27, 2005
Posts: 42

Hi

can someone tell me how to validate the following using struts...

1) date field should be greater than a particular date
eg: dateOfBirth should be greater than 10/10/1980

2) a field should accept values from a closed set of values
eg: sex should be either Male or Female

3) one of the 'N' number of fields are mandatory
eg: there are three fields called txnRef, suite, email. User
should enter atleast one of these three values.

appreciate any help on these questions..
thanks in advance
Jim.
[ December 30, 2005: Message edited by: Jim Patrick ]
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

You never mentioned if you are using the validation framework. Are you writing code for your ActionForms' validate method or are you setting up validations with the framework in validation.xml?


A good workman is known by his tools.
Jim Patrick
Ranch Hand

Joined: Dec 27, 2005
Posts: 42

Originally posted by Marc Peabody:
You never mentioned if you are using the validation framework. Are you writing code for your ActionForms' validate method or are you setting up validations with the framework in validation.xml?


Hi Marc,

yes i am using the validation framework..and setting up validations with framework in validations.xml. can u provide me some validation examples for my questions pls..


Rgds,
Jim
[ December 28, 2005: Message edited by: Jim Patrick ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validation question
 
Similar Threads
Display values in chronological order
Struts2 Problem in validation
startdate,endDate validations how is it done?
NX: URLYBird / my approach of the reading problem
Date picker in struts 1.1