struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Set parameter for both params interceptors in paramsPrepareParamsStack
Date Thu, 10 Oct 2013 08:32:49 GMT
It should work as you reference the same instance (interceptors are
instantiated per stack), maybe it is something else?

Maybe try copy paramsPrepareParamsStack and redefine excludeParams?


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

2013/10/9 Dmytro Kostiuchenko <dmytro.kostiuchenko@gmail.com>:
> Hi all.
>
> I'm new to struts2 and may miss something obvious, indeed need someone
> to help me.
>
> I have an application with the following interceptors stack applied by default
>
>     <interceptor-stack name="myStack">
>       <interceptor-ref name="myInterceptor"/>
>       <interceptor-ref name="tokenSession"/>
>       <interceptor-ref name="paramsPrepareParamsStack">
>         <param name="params.excludeParams">...,token</param>
>         <!-- notice 'token' -->
>       </interceptor-ref>
>       <interceptor-ref name="store">
>         <param name="operationMode">AUTOMATIC</param>
>       </interceptor-ref>
>     </interceptor-stack>
>
> When in dev mode I see many ERROR entries in log like this one:
>
>     Error setting expression 'token' with value ['...', ]
>
> The problem here is that referred paramsPrepareParamsStack has 2
> 'params' interceptors,
> but 'excludeParams' parameter is set only for the first one. And the
> second one retains defaults.
>
>     <interceptor-stack name="paramsPrepareParamsStack">
>       <interceptor-ref name="exception"/>
>       <interceptor-ref name="alias"/>
>       <interceptor-ref name="i18n"/>
>       <interceptor-ref name="checkbox"/>
>       <interceptor-ref name="multiselect"/>
>       <interceptor-ref name="params"> <!-- the first one -->
>         <param name="excludeParams">...</param>
>       </interceptor-ref>
>       <interceptor-ref name="servletConfig"/>
>       <interceptor-ref name="prepare"/>
>       <interceptor-ref name="chain"/>
>       <interceptor-ref name="modelDriven"/>
>       <interceptor-ref name="fileUpload"/>
>       <interceptor-ref name="staticParams"/>
>       <interceptor-ref name="actionMappingParams"/>
>       <interceptor-ref name="params"> <!-- the second one. How to refer it?
-->
>         <param name="excludeParams">...</param>
>       </interceptor-ref>
>       <interceptor-ref name="conversionError"/>
>       <interceptor-ref name="validation">
>         <param name="excludeMethods">input,back,cancel,browse</param>
>       </interceptor-ref>
>       <interceptor-ref name="workflow">
>         <param name="excludeMethods">input,back,cancel,browse</param>
>       </interceptor-ref>
>     </interceptor-stack>
>
> Is there any way to set interceptor parameter for multiple
> interceptors having the same name?
>
> Thanks in advance.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

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


Mime
View raw message