[
https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43645#action_43645
]
Gabriel Belingueres commented on WW-2595:
-----------------------------------------
Hi,
I just thought that it is more reliable to see a real struts.xml file because
it represents a real test case. This seems more like an hypotheses than a test
case.
I would not fully reproduce this case, since there are parts missing:
a) "myInterceptor" is not defined. (May be it does not has anything to do with
the problem but why not providing it?)
b) If myInterceptor is custom made, how are the parameters initialized? Is it
throwing exceptions? Is it thread-safe?
c) Does it fails on start-up? or it fails under heavy load?
> Overriding subset of interceptor params
> ---------------------------------------
>
> Key: WW-2595
> URL: https://issues.apache.org/struts/browse/WW-2595
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.0.11
> Reporter: Jon Wilmoth
>
> 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
> leaves the params that aren't overridden in the action (but defined in stack
> definition) null. 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. 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 (causing the interceptor logic to break) 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>
> BTW...defining the action with all parameters overridden (see below) 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>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.