Hi Olivier, I am using Struts2.0.6 and trying to implement Validator framework but couldn't succeed. I have confution to give name of actionname-validator.xmlfile. I am here giving action cofiguration in Struts.xml
<action name="*UserManagementAction" method="{1}" class=" com.realsoftinc.appcentral.web.user.UserManagementAction"> <interceptor-ref name="validationWorkflowStack" /> <result name="success">/adduser.jsp</result> <result name="input">/adduser.jsp</result> </action> I have implemented UserManagementAction.java with 4 methods(addNew,Update,delete,execute) which return SUCCESS and INPUT. In that i want validation in only 2 methods(addNew,Update). If i would create UserManagementAction-validation.xml then validation is executed for all 4 methods. but if i would create UserManagementAction-addNew-validation.xml then it is not executed for addNew method. In my JSP there are 3 submit button with assigned method named addNew,Update,delete. So what should i do to execute validation for addNew and Update method? Please Help me to solve this problem. Vijay Prajapati On 5/29/07, Olivier THIERRY <[EMAIL PROTECTED]> wrote:
I think you have to add validation interceptor to your action. Try something like that : <action name="Logon_*" method="{1}" class="tutorial.Logon"> <interceptor-ref name="validationWorkflowStack" /> <result type="redirect-action">Menu</result> <result name="input">/jsp/Logon.jsp</result> </action> Hope it helps ;) 2007/5/29, robinbajaj <[EMAIL PROTECTED]>: > > > <sorry, reposting my previous message with more appropriate subject line > > > > I am a Struts 2 newbie. The validation piece from Struts 2 bootstrap > tutorial is > not kicking in, and does not show the validation error messages even when > I > provide invalid data. > > I started my this struts2 project using the the Maven Starter Archetype > (struts2-archetype-starter) > and my Logon-validation.xml is located src/main/resources folder, which > gets > copied in Web-inf/classes folder on deployment (done through mvn > jetty:run). > > I am trying to following this link from Struts2 bootstrap tutorial > http://struts.apache.org/2.x/docs/validating-input.html > > and have an issue at the Validation Input piece. > > I have created my Logon.java (my action), my logon.jsp and correctly > mapped > them in struts.xml > > Here's my struts.xml code. > http://rafb.net/p/KG8ELQ25.html > > Here's my Logon.java > http://rafb.net/p/vNR89E61.html > > Here's my Logon.jsp > http://rafb.net/p/rOZl5r57.html > > Here's my Logon-Validation.xml > http://rafb.net/p/FToVf186.html > > I give in empty username and password and hit submit, and get returned to > the Logon.jsp without showing the error messages. Can someone please point > out what's wrong. ?? > > > -- > View this message in context: > http://www.nabble.com/-s2--Validation-does-not-work-in-Struts-2-basic-project-tf3830792.html#a10845117 > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >