wood burning stoves 2.0*
The moose likes Struts and the fly likes Question: Can I validate multiple forms with 1 set of rules? Or multiple fields with 1 rule? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Question: Can I validate multiple forms with 1 set of rules? Or multiple fields with 1 rule?" Watch "Question: Can I validate multiple forms with 1 set of rules? Or multiple fields with 1 rule?" New topic
Author

Question: Can I validate multiple forms with 1 set of rules? Or multiple fields with 1 rule?

baron zemm
Greenhorn

Joined: Jan 12, 2010
Posts: 1
I have a whole bunch of forms (about 100) that generally fall into 4-5 groups.

Each set of forms have identical fields.

Right now our struts validation xml file is setup with the forms rules matching the actual forms on a 1 to 1 basis.

Is there any way I can set it up so that the same field validation rules are applied to multiple different forms.
Basically so I can trim down the size of my giant rule file to a more manageable level and reduce the maintenance?

Or even any way to setup global field validation rules that apply to all forms.

Almost every form has fields like date or priority that have masks, required, and validwhen validators applied.
So it doesn't look like I can use global constants for those fields?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question: Can I validate multiple forms with 1 set of rules? Or multiple fields with 1 rule?
 
Similar Threads
Struts2 - Conditional validation
Valid when
Validator not picking up error message resources
Dynamic action path to share same validation configuration
Group variable validation