Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validating dynamic variables

 
Manish Hatwalne
Ranch Hand
Posts: 2591
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might be easy but I am unable to find a clean solution.
How can can I add validation for a dynamic variable in my Struts framework (validation.xml) like a normal variable.

I am creating input fields dynamically such as "email_1", "email_2" etc, and I would like it to be validated in the validation framework itself instead of delegating it to the struts action. How do I do this?

TIA,
- Manish
 
Manish Hatwalne
Ranch Hand
Posts: 2591
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any inputs on this one?

TIA,
- Manish
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The validation framework is convenient for common validation tasks. I find that anything complex is easier to implement in my form's validate method. Just remember to call super.validate.

- Brent
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic