Hi Ian, I had looked into visitor validator earlier and had misunderstood it and thought the top level model object had to be given for using visitor validator but guess not. I looked it up more deeply and yes I am able to remove the duplication of validation almost fully. An xml still need to be created for each scenario but still the validation for a field resides in a single file and so in case future we have to modify it it needs to be done only at one location.
But still I feel the ability to include one file within another would be a welcome addition to validation in struts2. Thanks for making me lookup visitor validator again! Thanks & Regards, Arup Ian Roughley wrote: > > Have you looked at the visitor validator? It might serve your purposes > if the fields are on objects in the action. > > /Ian > > Arup Francis wrote: >> Hi, >> >> We have this problem of having to repeat certain validations for the >> same >> fields in multiple validation xml files because they occur in multiple >> scenarios and we have different validation files for the different >> scenarios. Now this brings about duplication of code in the sense that in >> future if I need to modify the validation for the fields then I have to >> do >> it in multiple files which is quite a pain. I was thinking that if it was >> possible to have the ability to include one validation file within >> another >> validation xml then it would help us in removing the duplication of code >> because I could define the validation for the fields in a single file and >> then include that file in the multiple scenario validation files. >> >> Its something like the <s:include /> that you have for the struts.xml >> using >> which you can include other struts configuration files. >> >> Struts 2 gurus - Please let me know on what you feel about this. >> Maybe this can be added as an enhancement in future versions of struts2. >> >> Arup >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Adding-the-ability-to-include-a-validation-xml-file-from-inside-another-validation-xml-file-in-Struts2-tf4601659.html#a13154537 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]