You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@struts.apache.org by "lukaszlenart (via GitHub)" <gi...@apache.org> on 2026/02/07 18:38:32 UTC
[PR] WW-3647 Change autowire alwaysRespect default to true [struts]
lukaszlenart opened a new pull request, #1571:
URL: https://github.com/apache/struts/pull/1571
## Summary
- Change default value of `struts.objectFactory.spring.autoWire.alwaysRespect` from `false` to `true`
- Update JavaDoc in `StrutsConstants.java` to reflect new default and reference WW-3647
- Update field default in `SpringObjectFactory.java`
## Problem
When a Spring String bean exists (e.g., JNDI lookup with default-value), Spring's `AUTOWIRE_CONSTRUCTOR` strategy incorrectly injects that value into ALL String parameters of `ServletActionRedirectResult` constructors, causing malformed redirect URLs like:
```
http://localhost:8080/XXXX/index!XXXX.action#XXXX
```
## Solution
Change the default to `true` so Spring respects the configured autowire strategy (`AUTOWIRE_BY_NAME` by default) instead of using the legacy mixed injection approach that always tries constructor injection first.
## Migration Notes
Users who rely on the legacy constructor autowiring behavior can restore it by setting:
```xml
<constant name="struts.objectFactory.spring.autoWire.alwaysRespect" value="false" />
```
## Test plan
- [x] All Spring plugin tests pass (`SpringObjectFactoryTest` - 11 tests)
- [ ] Manual verification with JNDI String bean scenario
Fixes [WW-3647](https://issues.apache.org/jira/browse/WW-3647)
🤖 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: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] WW-3647 Change autowire alwaysRespect default to true [struts]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #1571:
URL: https://github.com/apache/struts/pull/1571#issuecomment-3865072546
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1571) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1571&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1571&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1571&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1571&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1571&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1571)
--
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: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] WW-3647 Change autowire alwaysRespect default to true [struts]
Posted by "lukaszlenart (via GitHub)" <gi...@apache.org>.
lukaszlenart merged PR #1571:
URL: https://github.com/apache/struts/pull/1571
--
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: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org