File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validation question

 
Jim Patrick
Ranch Hand
Posts: 42
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Jim Patrick
Ranch Hand
Posts: 42
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic