[ 
https://issues.apache.org/jira/browse/WW-5514?focusedWorklogId=1004236&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1004236
 ]

ASF GitHub Bot logged work on WW-5514:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Feb/26 17:03
            Start Date: 09/Feb/26 17:03
    Worklog Time Spent: 10m 
      Work Description: 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)




Issue Time Tracking
-------------------

    Worklog Id:     (was: 1004236)
    Time Spent: 40m  (was: 0.5h)

> Allow configuration of ProxyUtil for cache types
> ------------------------------------------------
>
>                 Key: WW-5514
>                 URL: https://issues.apache.org/jira/browse/WW-5514
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 6.6.0
>            Reporter: Jon Pulice
>            Assignee: Lukasz Lenart
>            Priority: Minor
>             Fix For: 6.9.0, 7.2.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Since 6.6.0, the ProxyUtil class now always uses the WTLFU cache type when 
> creating its two internal caches. This means that the caffeine 
> library is now mandatory when it was not before.
> {code:java}
>   private static final OgnlCache<Class<?>, Boolean> isProxyCache = (new 
> DefaultOgnlCacheFactory(10000, OgnlCacheFactory.CacheType.WTLFU, 256))
>     .buildOgnlCache();
>   private static final OgnlCache<Member, Boolean> isProxyMemberCache = (new 
> DefaultOgnlCacheFactory(10000, OgnlCacheFactory.CacheType.WTLFU, 256))
>     .buildOgnlCache();{code}
>  
> Prior to 6.6.0, setting both of these configuration options would allow you 
> to omit the caffeine dependency from an application:
> {code:java}
> <constant name="struts.ognl.expressionCacheType" value ="basic" />
> <constant name="struts.ognl.beanInfoCacheType" value="basic" />{code}
>  
> Would it be possible to allow for the cache type used by the ProxyUtil class 
> to be configurable as well similar to the above?



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

Reply via email to