Hi mraible, Thanks for your answer. I custom validators successful now. Another question : How to define a new validator rule to validators.xml
Example : <validator name="my_validator" class="src.main.resources.com.mycompany.app.validators.MyValidator"/> Thanks much! mraible wrote: > > I would try adding it to src/main/resources. > > Matt > > On Fri, Apr 24, 2009 at 1:33 AM, Kenny Ha <vifaxoc...@yahoo.com> wrote: > >> >> I'm using Struts 2 Basic framework. >> I wanna customize validator required,requiredstring,email and url by my >> validator rule so I create a validators.xml : >> >> <?xml version="1.0" encoding="UTF-8"?> >> <!DOCTYPE validators PUBLIC >> "-//OpenSymphony Group//XWork Validator Config 1.0//EN" >> >> "http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd"> >> >> <validators> >> <validator name="required" >> class="src.main.resources.com.mycompany.app.validators.RequiredValidator"/> >> <validator name="requiredstring" >> >> class="src.main.resources.com.mycompany.app.validators.RequiredStringValidator"/> >> <validator name="email" >> class="src.main.resources.com.mycompany.app.validators.EmailValidator"/> >> <validator name="url" >> class="src.main.resources.com.mycompany.app.validators.URLValidator"/> >> </validators> >> >> But I have no idea where add this validators.xml to and how to configure >> to >> tell Struts 2 use it?? >> please help me solve this. >> >> Thanks much! >> >> -- >> View this message in context: >> http://www.nabble.com/Registering-Validators---tp23211373s2369p23211373.html >> Sent from the AppFuse - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net >> For additional commands, e-mail: users-h...@appfuse.dev.java.net >> >> > > -- View this message in context: http://www.nabble.com/Registering-Validators---tp23211373s2369p23212097.html Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net For additional commands, e-mail: users-h...@appfuse.dev.java.net