aspose file tools*
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
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Validation question