You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jon Wilmoth <jo...@yahoo.com> on 2007/05/30 18:47:00 UTC

[S2] How Validators of an Action are Found

http://struts.apache.org/2.x/docs/validation.html says:

Validation rules can be specified: 
Per Action class: in a file named ActionName-validation.xml
Per Action alias: in a file named ActionName-alias-validation.xml
Inheritance hierarchy and interfaces implemented by Action class: XWork searches up the inheritance tree of the action to find default validations for parent classes of the Action and interfaces implemented

Unfortunately the documentation  doesn't tie the alias back to a specific struts.xml configuration element.   Is the alias supposed to be the action's method name if it's not the default "execute"?

For example does the action configuration below require MyActionSave-save-validation.xml?

<action name="MyActionSave" ... method="save">
   <interceptor-ref name="formStack"/>
   <result>/result.jsp</result>
</action>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] How Validators of an Action are Found

Posted by Musachy Barroso <mu...@gmail.com>.
for:

<action name="MyActionSave"  class="MyAction" method="save">
  <interceptor-ref name="formStack"/>
  <result>/result.jsp</result>
</action>

it would be

MyAction-save-validation.xml.

musachy

On 5/30/07, Jon Wilmoth <jo...@yahoo.com> wrote:
>
> http://struts.apache.org/2.x/docs/validation.html says:
>
> Validation rules can be specified:
> Per Action class: in a file named ActionName-validation.xml
> Per Action alias: in a file named ActionName-alias-validation.xml
> Inheritance hierarchy and interfaces implemented by Action class: XWork
> searches up the inheritance tree of the action to find default validations
> for parent classes of the Action and interfaces implemented
>
> Unfortunately the documentation  doesn't tie the alias back to a specific
> struts.xml configuration element.   Is the alias supposed to be the
> action's method name if it's not the default "execute"?
>
> For example does the action configuration below require
> MyActionSave-save-validation.xml?
>
> <action name="MyActionSave" ... method="save">
>    <interceptor-ref name="formStack"/>
>    <result>/result.jsp</result>
> </action>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd