File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
 
wood burning stoves
 
subject: Validating dynamic variables
 
Similar Threads
Apache Struts 2 Web Application Development
How to perform validation conditionally ?
DynaValidatorForm
DynaActionForm not working
validation: replacing {0} with the value the user entered