struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: intercepter parameters in actions
Date Thu, 27 Jun 2013 05:41:39 GMT
Interceptors are singletons per stack - if you referencing them with
interceptor-ref from within actions you are reusing the same instance.


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

2013/6/26 Cameron Morris <cmorris@part.net>:
> Hello Strut-ers,
>
> When I override an interceptor's parameter in several actions, only the
> last action's parameters are applied.  (Note I'm not referencing a stack,
> but just one interceptor.) I was expecting that a separate interceptor was
> created for each action or that the param would be set before the action
> was called.  Here is an example:
>
> <action name="action1" class="example.myAction1">
>  <intercepter-ref name="myInterceptor">
>    <param name="param">A</param>
>  </intercepter-ref>
> </action>
> <action name="action2" class="example.myAction2">
>  <intercepter-ref name="myInterceptor">
>    <param name="param">B</param>
>  </intercepter-ref>
> </action>
> <action name="action3" class="example.myAction3">
>  <intercepter-ref name="myInterceptor">
>    <param name="param">C</param>
>  </intercepter-ref>
> </action>
>
> When calling action1, action2, and action3 the "param" of "myInterceptor"
> is always C.  Is this expected behavior or is this bug?
>
> - Cam Morris

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


Mime
View raw message