Oscar
Tue, 17 Nov 2009 15:04:23 -0800
ben_979 escribió:
You have to specify in your struts.xml that the validation doesn't apply to the other action methods. To do that in the reference of the default interceptor/interceptor stack for your action you specify parameters for interceptors, like this:I'm trying to figure out the validation framework, and I don't have a clear understanding from the docs I've read where I'm going wrong, so if someone could point me in the right direction I'd appreciate it. I'm trying to validate ONLY when a particular method of an action class is being called. The action class is called ScheduleDetailAction and the method is called update(). If I name the validation file ScheduleDetailAction-validation.xml, the validation is invoked, but it is invoked ALL of the time, I only want it when the update() method is called. I'm reading that the naming convention I need to use for the xml file is ActionName-ActionAlias-validation.xml, but what exactly an "ActionAlias" is isn't clear to me. The method is called from a form on a jsp page as follows: <s:form action="ScheduleDetailAction_update" validate="true"> I've tried calling the validation file ScheduleDetailAction-update-validation.xml and ScheduleDetailAction-ScheduleDetailAction_update-validation.xml (and about 15 other things!!!) and I cannot get the validation to be invoked BEFORE the update method is called. Any suggestions as to what I'm doing incorrectly would be greatly appreciated.
<interceptor-ref name="yourInterceptorStack" ><param name="workflow.excludeMethods">method1, method2</param> <param name="validation.excludeMethods">method1, method2</param>
</interceptor-ref>
With this, you are telling that the methods method1 and method2 won't be
validated.
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org