Skip to content

WW-5326 Upgrade OGNL from 3.4.10 to 3.5.0-BETA4 and introduce StrutsContext#1654

Draft
lukaszlenart wants to merge 9 commits intomainfrom
feat/ognl-3.5-upgrade
Draft

WW-5326 Upgrade OGNL from 3.4.10 to 3.5.0-BETA4 and introduce StrutsContext#1654
lukaszlenart wants to merge 9 commits intomainfrom
feat/ognl-3.5-upgrade

Conversation

@lukaszlenart
Copy link
Copy Markdown
Member

Summary

Fixes WW-5326

Upgrades Apache Struts from OGNL 3.4.10 to 3.5.0-BETA4 and introduces StrutsContext extends OgnlContext<StrutsContext> as the framework's own OGNL evaluation context. This lays the foundation for treating OGNL as an execution sandbox with typed, Struts-specific context state.

Changes

  • OGNL version bump: 3.4.10 → 3.5.0-BETA4 (Java 17 baseline)
  • StrutsContext: New class extending OgnlContext<StrutsContext> — Struts' own OGNL context
  • Generic type ripple: All OGNL interface implementations parameterized with <StrutsContext> (~22 classes in core)
  • Direct context construction: Replaced Ognl.createDefaultContext() with direct new StrutsContext(...) in OgnlUtil, OgnlValueStack
  • Tiles plugin: Accessors use raw OgnlContext with @SuppressWarnings("rawtypes") since OGNL internally creates raw OgnlContext when calling Ognl.getValue()
  • Tests: Updated 9 test files, all 2908 core tests pass

Design decisions

  • Direct construction over Ognl.withBuilderProvider(): Gives Struts full ownership of context lifecycle, avoids global-state issues
  • Tiles raw types: Tiles accessors operate outside Struts' context lifecycle — OGNL's internal Ognl.getValue() creates raw OgnlContext, not StrutsContext, so tiles must use raw types
  • Phase 1 only: This PR introduces the class with zero behavioral change. Promoting ReflectionContextState map entries to typed StrutsContext fields is Phase 2

Test plan

  • Core module: 2908 tests, 0 failures
  • Tiles plugin: 545 tests, 0 failures
  • Spring plugin: 61 tests, 0 failures
  • JSON, REST plugins: all pass
  • Full CI pipeline validation

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

lukaszlenart and others added 9 commits April 6, 2026 18:10
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…utsContext>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…h StrutsContext

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… StrutsContext construction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sContext

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tiles accessors are called by OGNL internal machinery with raw OgnlContext,
not within a Struts evaluation context, so they cannot use StrutsContext.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant