This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes can we have multiple validation.xml files to handle valdations of different forms? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "can we have multiple validation.xml files to handle valdations of different forms?" Watch "can we have multiple validation.xml files to handle valdations of different forms?" New topic
Author

can we have multiple validation.xml files to handle valdations of different forms?

kiran nyala
Ranch Hand

Joined: Sep 21, 2009
Posts: 47

hi

can we have multiple validation.xml files to handle valdations of different forms?

I have written only one validation.xml, one formbean (ActionForm) to handle multiple jsp form elements. But when i use validation frame work all validations written in validation.xml are taking place irrespective of submitting JSP form elements.
so i need to validate only the elements submitted in jsp using this single validation.xml, is there any way to do it?

My code is as follows (Struts 1.2)

1)index.jsp


2)home.jsp


3)struts-config.xml


4) validation.xml





Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

you can make multiple validation.xml file depending on Action classes such e.g.

<actionClass>-<actionAlias>-validation.xml
yourActionClass-firstAction-validation.xml
yourActionClass-secondAction-validation.xml

Learning some thing New Every Day
 
Don't get me started about those stupid light bulbs.
 
subject: can we have multiple validation.xml files to handle valdations of different forms?
 
Similar Threads
Problem in struts validator
strust ejb validation glassfish netbeans cannot find bean in any scope
Exception while loading the validation.xml in strusts
Validation framework is not working
Struts 1.3 validation: request attributes are lost after submit form