Hi Saddiq, Thanks for your help.... I am not able to understand meaning of below line You can achive this by creating an separate file for each method ...do you mean that i should create separate action class for each method or you mean to say separate validation file for each method of an action class...
By your suggestion, I need to create multiple action mappings in struts.xml for each of the method of the action class.... Can we avoid this multiple action mappings by wildcard characters.....? Please suggest your opinion..... I am also waiting for some reply on Question 2 I have asked on earlier mail.... Thanks Gaurav On Sat, Nov 7, 2009 at 6:02 PM, Siddiq Syed <siddiq...@yahoo.com> wrote: > You can achive this by creating an seprate file for each method and add the > validation. > When ever the a method from the action class is invoked the corresponding > validation will get invoked. > > actionname-aliasname-validationname.xml > > actinname -- name of your actin class. > aliasname -- name of the action specifed in the strust-xml file. > > <action name="x" class="com.yaction" method="x"> > <result name="input" type="tiles">validationresult.jsp</result> > </action> > > name of the validation file for the above mention action will be > > yaction-x-validation.xml -- where you can define the validation and will be > invoke when action x is invoked. > > > -Siddiq. > > > > ________________________________ > From: gaurav nigam <mailgaura...@gmail.com> > To: Struts Users Mailing List <user@struts.apache.org> > Sent: Sat, November 7, 2009 12:14:32 PM > Subject: query regarding Input Validation > > Hi All, > > I have a query regarding input validation. > > # Can we use method wise input validation in struts 2 ? > if this is not supported directly, then is there any workaround for the same. > > #To utilise the xml based validation, I have to create different > action class for same module...like module is "user" and i had to > create different action classes like adduser.action, modifyuser.action > class etc...i have to do this as there are some fields which are > different in each action....ideally i want to have single action class > with different methods like add, modify, etc... to handle this..but > can not do it so as same set of validation will be called for each > method...which is not required in my case... > > After some search and study, i came to know that there is annotation > validation which can be used and will be invoked per method...as > mentioned in this link > http://struts.apache.org/2.0.14/docs/validations-annotation.html > > but here, in need to hard code, my messages which i really want to > avoid it, Is there any way to use property file here...please provide > suggestion on this..... > > I have also learned that this annotation validation will not work for > client side validation. Is there any work around for this.... > > > Kindly help me in this regard > > > Thanks > > Gaurav > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org