lukaszlenart opened a new pull request, #1414:
URL: https://github.com/apache/struts/pull/1414

   ## Summary
   
   Fixes [WW-5586](https://issues.apache.org/jira/browse/WW-5586) - Enable 
`WithLazyParams` interceptors to be configured via interceptor stack parameters.
   
   ## Problem
   
   Previously, interceptors implementing `WithLazyParams` could not be 
configured through interceptor stack parameter syntax because 
`DefaultInterceptorFactory` skipped property setting entirely for these 
interceptors. This prevented configurations like:
   
   ```xml
   <interceptor-ref name="defaultStack">
       <param name="actionFileUpload.allowedTypes">image/png,image/jpeg</param>
       <param name="actionFileUpload.maximumSize">${maxUploadSize}</param>
   </interceptor-ref>
   ```
   
   ## Solution
   
   Modified `DefaultInterceptorFactory` to always set properties during 
interceptor creation, regardless of `WithLazyParams` interface implementation. 
Expression parameters (containing `${...}`) are re-evaluated at invocation time 
via `LazyParamInjector`, while static parameters remain unchanged.
   
   ## Changes
   
   - **DefaultInterceptorFactory.java**: Removed conditional logic that skipped 
property setting for `WithLazyParams` interceptors
   - **WithLazyParams.java**: Updated JavaDoc to clarify dual initialization 
behavior (factory time + invocation time)
   - **Tests**: Added `testInvokeWithLazyParamsStackConfiguration()` to verify 
both static and expression parameters work in stacks
   - **MockLazyInterceptor**: Enhanced to support both static and expression 
parameters for testing
   
   ## Testing
   
   - ✅ All 16 tests in `DefaultActionInvocationTest` pass
   - ✅ All 33 interceptor-related tests pass
   - ✅ Backward compatibility confirmed - existing expression evaluation still 
works
   - ✅ New functionality works - static stack parameters now configurable
   
   ## Benefits
   
   This unblocks **WW-5585** and enables combining static security constraints 
with dynamic expressions in the same interceptor stack reference.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to