Hello Eric,
Another way of doing this would be using aliases. In other words the
validation.xml file follows the action name not the class.
If you send save action "foo-save" and method "save"
<action name="foo-*" class="FooAction" method="{1}">
<result name="success">pages/foo.jsp</result>
You create one declarative validation file per call
So you add a validation file per possible action ....
foo-save.xml
foo-delete.xml
etc....
why not check :
http://struts.apache.org/2.x/docs/validation.html#Validation-HowValidato
rsofanActionareFound
http://struts.apache.org/2.x/docs/validation.html#Validation-DefiningVal
idationRules
-----Original Message-----
From: Eric Lentz [mailto:[email protected]]
Sent: lundi 18 juillet 2011 14:16
To: Struts Users Mailing List
Subject: Re: Conditional fire on validation()
> I'm not sure it's exactly what you're looking for, but IIRC there
should
be
> a convention for the validate method, such that you can call, for
example, a
> method validateSave, expecting that it's fired contextually with the
save
> action
>
> Maurizio Cucchiara
Oh yeah! I remember coming across that now. Post 40 with all these
frameworks I have stuffed in my head... thanks for the reminder.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]