I am new to Struts. I want to do validation by plugin struts validator. I googled and copied and pasted the following in struts-config file <!-- Validator Configuration --> <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> <set-property property="pathnames" value="/WEB-INF/validator/validator-rules.xml,/WEB-INF/validator/validations.xml"/> </plug-in>
but I don't see any of these files under WEB-INF, I think I have to add some jar files.
Could you please help me how to get both the validator files in web-inf.
The validator-rules.xml file is provided by Struts, and contains the built-in validation rules. Formerly, you were expected to put this file in WEB-INF, but in verstion 1.3 and above, it's contained in the stuts-core-1.3.x.jar file, and you should reference it as: "/org/apache/struts/validator/validator-rules.xml". As long as the struts-core jar file is in your WEB-INF/lib folder, Struts will find it.
The validation.xml file, on the other hand is provided by you and contains the validation rules specific to your application. Just look in either the struts-examples or struts-blank war files that came with the download, and you'll find some examples that you can use as a template for yours. By convetion it's placed in WEB-INF/. [ September 26, 2007: Message edited by: Merrill Higginson ]