You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Jon Wilmoth (JIRA)" <ji...@apache.org> on 2008/04/17 04:01:05 UTC
[jira] Created: (WW-2595) Overriding subset of interceptor params
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.
[jira] Updated: (WW-2595) Overriding subset of interceptor params
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Don Brown updated WW-2595:
--------------------------
Fix Version/s: 2.1.3
> 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
> Fix For: 2.1.3
>
>
> 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.
[jira] Resolved: (WW-2595) Overriding subset of interceptor params
Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Musachy Barroso resolved WW-2595.
---------------------------------
Resolution: Not A Problem
documented
> Overriding subset of interceptor params
> ---------------------------------------
>
> Key: WW-2595
> URL: https://issues.apache.org/struts/browse/WW-2595
> Project: Struts 2
> Issue Type: Improvement
> Affects Versions: 2.0.11
> Reporter: Jon Wilmoth
> Fix For: Future
>
>
> 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.
[jira] Commented: (WW-2595) Overriding subset of interceptor params
Posted by "Gabriel Belingueres (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43631#action_43631 ]
Gabriel Belingueres commented on WW-2595:
-----------------------------------------
I would recommend that you post the *real* struts.xml section that reproduces the problem.
Regards,
Gabriel
> 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.
[jira] Commented: (WW-2595) Overriding subset of interceptor params
Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45627#action_45627 ]
Musachy Barroso commented on WW-2595:
-------------------------------------
I added an entry to http://struts.apache.org/2.1.6/docs/interceptors.html#Interceptors-InterceptorParameterOverriding to explain how inheritance works (or how it doesn't)
> Overriding subset of interceptor params
> ---------------------------------------
>
> Key: WW-2595
> URL: https://issues.apache.org/struts/browse/WW-2595
> Project: Struts 2
> Issue Type: Improvement
> Affects Versions: 2.0.11
> Reporter: Jon Wilmoth
> Fix For: Future
>
>
> 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.
[jira] Commented: (WW-2595) Overriding subset of interceptor params
Posted by "Paul Nilsson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45626#action_45626 ]
Paul Nilsson commented on WW-2595:
----------------------------------
Hi,
We are also experiencing a similar problem using 2.1.6. We are using a prepare-params-prepare stack with a parameter filter interceptor prior to each params, so the stack in the parent package looks like:
<interceptor-stack name="parentStack">
.
.
.
<interceptor-ref name="prePrepareParameterFilter"/>
<interceptor-ref name="params"/>
<interceptor-ref name="prepare"/>
<interceptor-ref name="postPrepareParameterFilter">
<param name="defaultBlock">true</param>
</interceptor-ref>
<interceptor-ref name="params"/>
.
.
.
</interceptor-stack>
The idea behind this was to create a safe-by-default behavior when using the stack, so that objects that were prepared couldn't be set with malicious form submissions.
In simple cases this seems to work fine in child packages using this as a parent, and by default all parameters are blocked by the time it gets to the second params interceptor. In the case that we override a parameter of the postPrepareParameterFilter in the child package it seems to revert the ParameterFilterInterceptor to the default behavior where defaultBlock is false, therefore no parameters are blocked by the time it reaches the second parms interceptor.
So for example in the following package defaultBlock would be true (param apparently inherited from the parent package):
<package name="child1" namespace="/child1" extends="parentPackage">
<action name="list" class="com.domain.ChildAction" method="view">
<interceptor-ref name="parentStack"/>
<result type="tiles">main.child</result>
</action>
</package>
And in this example a parameter is set which seems to make the interceptor forget to inherit the parentStacks parameter for the interceptor, so defaultBlock is left at false.
<package name="child2" namespace="/child2" extends="parentPackage">
<action name="list" class="com.domain.ChildAction" method="view">
<interceptor-ref name="parentStack">
<param name="postPrepareParameterFilter.allowed">myObject.name</param>
</interceptor-ref>
<result type="tiles">main.child</result>
</action>
</package>
Not sure if this is the intended behavior or not. I read through the docs at http://struts.apache.org/2.1.6/docs/interceptors.html#Interceptors-InterceptorParameterOverriding but this didn't clear it up for me.
It seems to me that it's dangerous for an interceptor to stop inheriting parameters defined in a parent packages definition, just because an unrelated parameter was passed to that interceptor in the child package.
> Overriding subset of interceptor params
> ---------------------------------------
>
> Key: WW-2595
> URL: https://issues.apache.org/struts/browse/WW-2595
> Project: Struts 2
> Issue Type: Improvement
> Affects Versions: 2.0.11
> Reporter: Jon Wilmoth
> Fix For: Future
>
>
> 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.
[jira] Commented: (WW-2595) Overriding subset of interceptor params
Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43632#action_43632 ]
Dave Newton commented on WW-2595:
---------------------------------
@Gabriel: Why do you say that? Do you have the supplied snippets working as the bug submitter thinks they should, or any other useful information to provide?
> 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.
[jira] Commented: (WW-2595) Overriding subset of interceptor params
Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45924#action_45924 ]
Musachy Barroso commented on WW-2595:
-------------------------------------
Yes, that section was added, but I didn't mention that the other params would be null. I just fixed that.
> Overriding subset of interceptor params
> ---------------------------------------
>
> Key: WW-2595
> URL: https://issues.apache.org/struts/browse/WW-2595
> Project: Struts 2
> Issue Type: Improvement
> Affects Versions: 2.0.11
> Reporter: Jon Wilmoth
> Fix For: Future
>
>
> 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.
[jira] Commented: (WW-2595) Overriding subset of interceptor params
Posted by "Jon Wilmoth (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43643#action_43643 ]
Jon Wilmoth commented on WW-2595:
---------------------------------
I haven't tried the same thing in the original package. As soon as I do I'll update this ticket. When I entered the issue I wasn't sure if this should be an enhancement or a bug. Reading http://struts.apache.org/2.0.11.1/docs/package-configuration.html it says that "The extends attribute is optional and allows one package to inherit the configuration of one or more previous packages - including all interceptor, interceptor-stack, and action configurations." This leads me to believe that the interceptor's declaration should be inherited as packageB does extend packageA.
> 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.
[jira] Commented: (WW-2595) Overriding subset of interceptor params
Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45923#action_45923 ]
Wes Wannemacher commented on WW-2595:
-------------------------------------
I guess I'm not sure if this is still an issue... The docs you updated Musachy don't mention that overriding one parameter on a single interceptor nullifies any other parameters set on that interceptor. Is that the issue? If so, we can update the docs and maybe set this as 2.2.x.
> Overriding subset of interceptor params
> ---------------------------------------
>
> Key: WW-2595
> URL: https://issues.apache.org/struts/browse/WW-2595
> Project: Struts 2
> Issue Type: Improvement
> Affects Versions: 2.0.11
> Reporter: Jon Wilmoth
> Fix For: Future
>
>
> 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.
[jira] Commented: (WW-2595) Overriding subset of interceptor params
Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43633#action_43633 ]
Dave Newton commented on WW-2595:
---------------------------------
@Jon: Just out of curiosity, if you try the same thing in the original package (packageA in your example) does it work or is the behavior the same?
As a preliminary guess I would say that when an action gets its own interceptor-ref it's actually creating new instances of the interceptors. This implies that only properties set in the action's interceptor-ref would be set on the new interceptors.
I won't close this pending someone else confirming this; I'm just too swamped at the moment to dig into it; sorry.
> 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.
[jira] Updated: (WW-2595) Overriding subset of interceptor params
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Don Brown updated WW-2595:
--------------------------
Fix Version/s: (was: 2.1.3)
Future
Issue Type: Improvement (was: Bug)
This is the expected behavior - interceptor parameters are not inherited. Therefore, I'm changing this to an enhancement ticket, and if you can think of a better way this should be described in our docs, please either create a ticket or file a CLA and clean it up yourself. Thanks.
> Overriding subset of interceptor params
> ---------------------------------------
>
> Key: WW-2595
> URL: https://issues.apache.org/struts/browse/WW-2595
> Project: Struts 2
> Issue Type: Improvement
> Affects Versions: 2.0.11
> Reporter: Jon Wilmoth
> Fix For: Future
>
>
> 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.
[jira] Commented: (WW-2595) Overriding subset of interceptor params
Posted by "Gabriel Belingueres (JIRA)" <ji...@apache.org>.
[ 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.