WW-5514: Make ProxyUtil cache configurable via struts constants#1573
Merged
lukaszlenart merged 2 commits intorelease/struts-6-8-xfrom Feb 21, 2026
Merged
Conversation
2b924d9 to
6eee2f7
Compare
Makes the ProxyUtil cache type configurable through Struts constants, allowing applications to use BASIC cache type (default) without requiring Caffeine as a mandatory dependency. New configuration properties: - struts.proxy.cacheType: basic (default), lru, or wtlfu - struts.proxy.cacheMaxSize: 10000 (default) Fixes WW-5514 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
6eee2f7 to
bbc2afc
Compare
kusalk
reviewed
Feb 20, 2026
Member
kusalk
left a comment
There was a problem hiding this comment.
One initialisation race I'm concerned about, other than that looks good!
core/src/main/java/com/opensymphony/xwork2/util/StrutsProxyCacheFactoryBean.java
Outdated
Show resolved
Hide resolved
Extract lazy initialization into reusable LazyRef<T> utility with double-checked locking and reset support. ProxyUtil.setProxyCacheFactory() now resets both caches so they are recreated with the new factory, fixing the bug where caches were never refreshed after factory changes. Default proxy cache type changed from 'basic' to 'wtlfu' for consistency with expression and beanInfo caches. Fix @SInCE version to 6.9.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
kusalk
approved these changes
Feb 21, 2026
| /** | ||
| * Invalidates the cached value so the next {@link #get()} call recomputes it. | ||
| */ | ||
| public void reset() { |
Member
There was a problem hiding this comment.
Should technically be synchronized but anyway it's a super edge case so I wouldn't worry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
Makes the
ProxyUtilcache type configurable through Struts constants, allowing applications to use BASIC cache type (default) without requiring Caffeine as a mandatory dependency.Fixes WW-5514
Key Changes
OgnlCacheFactory@Injectconstructor reading from struts constantsProxyUtilduring container initializationConfiguration
New properties in
default.properties:Comparison with Struts 7.x approach (PR #1572)
This is a minimal/conservative fix for 6.x that:
ProxyUtilas a static utility (higher backward compatibility)SecurityMemberAccessThe Struts 7.x PR #1572 takes a more comprehensive approach with a full
ProxyServiceabstraction.Test Plan
SpringProxyUtilTest)🤖 Generated with Claude Code