GeeCON Prague 2014*
The moose likes Struts and the fly likes Validating dynamic variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validating dynamic variables" Watch "Validating dynamic variables" New topic
Author

Validating dynamic variables

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

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

Joined: Sep 22, 2001
Posts: 2578

Any inputs on this one?

TIA,
- Manish
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
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
 
GeeCON Prague 2014
 
subject: Validating dynamic variables