You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by rgm <st...@rgm.nu> on 2013/09/16 23:00:42 UTC

Providing "excludeParams" to ParametersInterceptor -- must expand "defaultStack"

If this is a duplicate message I apologize -- had some trouble subscribing.
 I'd like to provide some excludeParams to the ParametersInterceptor.  I
have two questions about this:

1)  If I provide my own "excludeParams" element like this:

<interceptor-ref name="params">
  <param name="excludeParams">token</param>
 </interceptor-ref>

Does this get added to the default list of parameters, or does it replace
it?  Is there any way that I can add my own parameters to the default list
of exclude parameters (like dojo\..* ) without replacing it?

2) Is there any way for me to provide the excludeParams parameter to the
"params" interceptor without "exploding" the defaultStack in my struts.xml?

Currently I have:
<interceptors>
       <interceptor name="logInterceptor"
class="com.rgm.interceptor.ActionLogInterceptor" />
       <interceptor-stack name="myDefaultStack">
            <interceptor-ref name="logInterceptor" />
            <interceptor-ref name="defaultStack"/>
        </interceptor-stack>
</interceptors>

Must I "explode" that "defaultStack" reference in order to provide the
"excludeParams" parameter to the "params" interceptor contained therein?

Thank you,
-rgm

Re: Providing "excludeParams" to ParametersInterceptor -- must expand "defaultStack"

Posted by Lukasz Lenart <lu...@apache.org>.
docs updated

https://cwiki.apache.org/confluence/display/WW/Interceptors#Interceptors-InterceptorParameterOverriding

2013/9/17 Lukasz Lenart <lu...@apache.org>:
> 2013/9/16 rgm <st...@rgm.nu>:
>> If this is a duplicate message I apologize -- had some trouble subscribing.
>>  I'd like to provide some excludeParams to the ParametersInterceptor.  I
>> have two questions about this:
>>
>> 1)  If I provide my own "excludeParams" element like this:
>>
>> <interceptor-ref name="params">
>>   <param name="excludeParams">token</param>
>>  </interceptor-ref>
>>
>> Does this get added to the default list of parameters, or does it replace
>> it?  Is there any way that I can add my own parameters to the default list
>> of exclude parameters (like dojo\..* ) without replacing it?
>
> It will override. Have you tried to use ParameterNameAware interface?
>
>> 2) Is there any way for me to provide the excludeParams parameter to the
>> "params" interceptor without "exploding" the defaultStack in my struts.xml?
>>
>> Currently I have:
>> <interceptors>
>>        <interceptor name="logInterceptor"
>> class="com.rgm.interceptor.ActionLogInterceptor" />
>>        <interceptor-stack name="myDefaultStack">
>>             <interceptor-ref name="logInterceptor" />
>>             <interceptor-ref name="defaultStack"/>
>>         </interceptor-stack>
>> </interceptors>
>>
>> Must I "explode" that "defaultStack" reference in order to provide the
>> "excludeParams" parameter to the "params" interceptor contained therein?
>
> I'm not sure what you mean by "explode" but you can setup params by
> referencing stack and interceptor
>
> http://struts.apache.org/development/2.x/docs/interceptors.html#Interceptors-InterceptorParameterOverriding
>
> Or
>
>         <interceptors>
>             <interceptor-stack name="parentStack">
>                 <interceptor-ref name="defaultStack">
>                     <param name="params.excludeParams">token</param>
>                 </interceptor-ref>
>             </interceptor-stack>
>         </interceptors>
>
>         <default-interceptor-ref name="parentStack"/>
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/

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


Re: Providing "excludeParams" to ParametersInterceptor -- must expand "defaultStack"

Posted by Lukasz Lenart <lu...@apache.org>.
2013/9/16 rgm <st...@rgm.nu>:
> If this is a duplicate message I apologize -- had some trouble subscribing.
>  I'd like to provide some excludeParams to the ParametersInterceptor.  I
> have two questions about this:
>
> 1)  If I provide my own "excludeParams" element like this:
>
> <interceptor-ref name="params">
>   <param name="excludeParams">token</param>
>  </interceptor-ref>
>
> Does this get added to the default list of parameters, or does it replace
> it?  Is there any way that I can add my own parameters to the default list
> of exclude parameters (like dojo\..* ) without replacing it?

It will override. Have you tried to use ParameterNameAware interface?

> 2) Is there any way for me to provide the excludeParams parameter to the
> "params" interceptor without "exploding" the defaultStack in my struts.xml?
>
> Currently I have:
> <interceptors>
>        <interceptor name="logInterceptor"
> class="com.rgm.interceptor.ActionLogInterceptor" />
>        <interceptor-stack name="myDefaultStack">
>             <interceptor-ref name="logInterceptor" />
>             <interceptor-ref name="defaultStack"/>
>         </interceptor-stack>
> </interceptors>
>
> Must I "explode" that "defaultStack" reference in order to provide the
> "excludeParams" parameter to the "params" interceptor contained therein?

I'm not sure what you mean by "explode" but you can setup params by
referencing stack and interceptor

http://struts.apache.org/development/2.x/docs/interceptors.html#Interceptors-InterceptorParameterOverriding

Or

        <interceptors>
            <interceptor-stack name="parentStack">
                <interceptor-ref name="defaultStack">
                    <param name="params.excludeParams">token</param>
                </interceptor-ref>
            </interceptor-stack>
        </interceptors>

        <default-interceptor-ref name="parentStack"/>


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

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