Thanks for the response.  The issue I'm seeing isn't with overriding parameters 
all parameters available, but rather just one or two out of all the interceptor 
params

Doesn't work:
<action name="myAction" class="myActionClass">
  <interceptor-ref name="myStack">
      <param name="myInterceptor.paramC">actionSpecificValue</param>
 </interceptor-ref>
</action>

Works:
<action name="myAction" class="myActionClass">
  <interceptor-ref name="myStack">
     <!--  same value as defined in "myStack" declaration  -->
     <param name="myInterceptor.paramA">defaultValueA</param>
     <!--  same value as defined in "myStack" declaration  -->
     <param name="myInterceptor.paramB">defaultValueB</param>
     <param name="myInterceptor.paramC">actionSpecificValue</param>
 </interceptor-ref>
</action>

The exception interceptor may not be a good example as it doesn't initialize 
any of the 3 parameters in the stack definition in struts-default.xml.  Any 
way, I've opened https://issues.apache.org/struts/browse/WW-2595 to capture the 
issue (or maybe enhancement).

----- Original Message ----
From: Gabriel Belingueres <[EMAIL PROTECTED]>
To: Struts Users Mailing List <user@struts.apache.org>; Jon Wilmoth <[EMAIL 
PROTECTED]>
Sent: Wednesday, April 16, 2008 4:55:25 PM
Subject: Re: Overriding subset of interceptor params

Seems OK to me (according to the current documentation.)

I've only overriden interceptor parameters in the declaration of a new
stack, and it is working OK:

      <interceptor-stack name="secureStack">
        <interceptor-ref name="auth" />
        <interceptor-ref name="defaultStack">
          <param name="exception.logEnabled">true</param>
          <param name="exception.logLevel">ERROR</param>
          <param name="exception.logCategory">my.package.here</param>
        </interceptor-ref>
      </interceptor-stack>

Try to create a new stack for your action (for testing pourposes only)
to see if the results are the same. If they are, post your struts.xml
file here.

2008/4/16, Jon Wilmoth <[EMAIL PROTECTED]>:
> I'm trying to override one of three interceptor parameters in an action 
> specific config using method #2 described in
> http://struts.apache.org/2.0.11.1/docs/interceptors.html#Interceptors-InterceptorParameterOverriding.
>   Unfortunately the other two parameters that I'm not overriding are not 
> being taken from the default stack definition and are ending up as null on 
> the interceptor.  Before I open a Jira bug (or enhancement request), I 
> thought I'd make sure a) this isn't user error b) the expected behavior is 
> "my" expected behavior (i.e. bug vs. enhancement).  Below is a sample action 
> config showing what I'm attempting...
>
> <package name="packageA"...>
>    <interceptors>
>        <interceptor name="myInterceptor" class="..."/>
>        <interceptor-stack name="myStack">
>            <interceptor-ref name="defaultStack"/>
>            <interceptor-ref name="myInterceptor">
>                <param name="paramA">defaultValueA</param>
>                <param name="paramB">defaultValueB</param>
>                <param name="paramC">defaultValueC</param>
>            </interceptor-ref>
>        </interceptor-stack>
> </package>
>
> With the following action config, the "myInterceptor" interceptor's  paramA & 
> paramB are null and not "defaultValueA" and "defaultValueB" as 
> expected/desired.
>
> <package name="packageB" extends="packageA"...>
>    <action name="myAction" class="myActionClass">
>        <interceptor-ref name="myStack">
>            <param name="myInterceptor.paramC">actionSpecificValue</param>
>        </interceptor-ref>
>    </action>
> </package>
>
> Thanks,
> Jon

Reply via email to