Lukasz Lenart created WW-5587:
---------------------------------

             Summary: WithLazyParams interceptors lose parameters in stack 
configurations
                 Key: WW-5587
                 URL: https://issues.apache.org/jira/browse/WW-5587
             Project: Struts 2
          Issue Type: Bug
          Components: Core Interceptors
            Reporter: Lukasz Lenart
             Fix For: 7.2.0


When interceptors implementing {{WithLazyParams}} are configured with 
parameters through interceptor stack references, the parameters are not stored 
in {{InterceptorMapping.getParams()}}, breaking the lazy parameter injection 
mechanism.

h3. Steps to Reproduce:

1. Create an interceptor implementing WithLazyParams
2. Configure it in an interceptor stack with parameter overrides:
    {code:xml}
     <interceptor-ref name="stackName">
         <param name="interceptorName.paramName">value</param>
     </interceptor-ref>
   {code}
3. During action invocation, {{LazyParamInjector.injectParams()}} receives 
empty params map

h3. Root Cause:

{{InterceptorBuilder.constructParameterizedInterceptorReferences()}}} at line 
177 creates {{InterceptorMapping}} without passing the params map:
{code:java}
new InterceptorMapping(key, interceptor)  // Missing params!
{code}

This should be:
{code:java}
    new InterceptorMapping(key, interceptor, map)
{code}

h3. Impact:
- WW-5586 fix successfully sets properties on interceptor instances at factory 
time
- However, {{LazyParamInjector}} cannot re-evaluate expression parameters at 
invocation time because {{InterceptorMapping.getParams()}} returns empty
- This breaks the dual initialization pattern for {{WithLazyParams}} 
interceptors in stack configurations

h3. Expected Behavior:
{{InterceptorMapping.getParams()}} should contain the parameter map so 
LazyParamInjector can re-evaluate expressions like {{$\{someValue\}}} at each 
action invocation.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to