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

   ## Summary
   
   Makes the `ProxyUtil` cache type configurable through Struts constants, 
allowing applications to use BASIC cache type (default) without requiring 
Caffeine as a mandatory dependency.
   
   Fixes [WW-5514](https://issues.apache.org/jira/browse/WW-5514)
   
   ### Key Changes
   
   - **ProxyCacheFactory interface** - marker interface for DI extending 
`OgnlCacheFactory`
   - **StrutsProxyCacheFactory** - implementation with `@Inject` constructor 
reading from struts constants
   - **StrutsProxyCacheFactoryBean** - wiring bean that sets the factory on 
`ProxyUtil` during container initialization
   - **ProxyUtil** - converted from static initialization to lazy 
initialization with factory injection
   - Configuration constants for proxy cache type and size
   
   ### Configuration
   
   New properties in `default.properties`:
   ```properties
   # Default (no Caffeine required)
   struts.proxy.cacheType=basic
   struts.proxy.cacheMaxSize=10000
   
   # High-performance option (requires Caffeine)
   struts.proxy.cacheType=wtlfu
   
   # LRU option (no Caffeine required)  
   struts.proxy.cacheType=lru
   ```
   
   ### Comparison with Struts 7.x approach (PR #1572)
   
   This is a minimal/conservative fix for 6.x that:
   - Keeps `ProxyUtil` as a static utility (higher backward compatibility)
   - Adds lazy initialization + configurable cache factory
   - Does not modify interceptors or `SecurityMemberAccess`
   
   The Struts 7.x PR #1572 takes a more comprehensive approach with a full 
`ProxyService` abstraction.
   
   ### Test Plan
   
   - [x] Core module tests pass (2664 tests)
   - [x] Spring plugin tests pass (67 tests, including `SpringProxyUtilTest`)
   - [ ] Manual testing with Spring AOP proxied actions
   
   🤖 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