Skip to content

Conversation

@lukaszlenart
Copy link
Member

@lukaszlenart lukaszlenart commented Feb 1, 2026

Summary

Backport of PR #1562 to the release/struts-6-8-x branch.

  • Cherry-picked commit e0d26837028fd44a227863e27f813c66386e3bf6 from main
  • Enables users to specify Spring bean names in struts-conversion.properties files instead of only fully qualified class names
  • Implements two-phase initialization: default converters during bootstrap, user converters after full container is built

Changes

  • Added UserConversionPropertiesProcessor for late initialization
  • Added UserConversionPropertiesProvider interface
  • Modified StrutsConversionPropertiesProcessor for two-phase processing
  • Updated DefaultConfiguration to trigger late initialization
  • Added tests for core and Spring plugin

Conflicts Resolved

  • Package imports adjusted for 6.8.x (com.opensymphony.xwork2 vs org.apache.struts2)
  • Java 8 compatibility fix (diamond operator with anonymous class)
  • @since tags updated to 6.9.0

Test plan

  • Core module tests pass (2666 tests)
  • Spring plugin tests pass (71 tests)
  • New StrutsConversionPropertiesProcessorTest passes
  • New SpringTypeConverterTest passes

Fixes WW-4291

🤖 Generated with Claude Code

Implement two-phase processing for conversion properties to enable
Spring bean name resolution in struts-conversion.properties files.

The issue was a timing problem: type converters were processed during
bootstrap phase before SpringObjectFactory was available. Now:
- Early phase: process struts-default-conversion.properties (class names)
- Late phase: process user properties when SpringObjectFactory is ready

Changes:
- Add UserConversionPropertiesProvider interface for late initialization
- Add UserConversionPropertiesProcessor to trigger late phase processing
- Split StrutsConversionPropertiesProcessor.init() into early/late phases
- Register new beans in DefaultConfiguration and struts-beans.xml
- Add alias in StrutsBeanSelectionProvider for dependency injection
- Improve JavaDocs for BeanSelectionProvider classes

Closes WW-4291

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@lukaszlenart lukaszlenart changed the title WW-4291: Allow Spring bean names for type converters (6.8.x backport) WW-4291: Allow Spring bean names for type converters (6.9.x backport) Feb 1, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 1, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
22 Security Hotspots
42.4% Coverage on New Code (required ≥ 80%)
3.4% Duplication on New Code (required ≤ 3%)
E Security Rating on New Code (required ≥ A)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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