What Is New in Apache Struts 7.2
| Category | Highlights |
|---|---|
| New Features |
|
| Improvements |
|
| Bug Fixes |
|
| Breaking Changes |
|
| Deprecations |
|
What security hardening does Struts 7.2 add?
Struts 7.2 closes several gaps around request parsing and parameter binding, which is where most historical Struts CVEs have originated. In practice, this release continues the parameter allowlisting work started in earlier 6.x and 7.x versions and pushes it deeper into REST and JSON handling.
The most notable additions:
- XML parsers used internally are hardened against entity expansion attacks (the classic "Billion Laughs" pattern), reducing the risk of denial-of-service via crafted XML configuration or payloads.
- The
PostbackResultnow HTML-encodes the form action attribute, closing an XSS vector in error-rendering scenarios. @StrutsParameteris now enforced when deserializing JSON and REST request bodies, not just for standard form parameters.- Jackson-based REST handlers gained per-property authorization, so individual fields can be rejected even if the containing object is otherwise allowed.
CookieInterceptoris now gated throughParameterAuthorizer, bringing cookie-based parameters under the same allowlist model as other inputs.- Redirect URL escaping in non-302 response bodies has been hardened, and
TokenHelperno longer logs raw token values.
This matters if your application exposes JSON or REST actions with model-bound properties. Watch out for actions whose setters were never explicitly annotated, since requests that previously populated those fields silently may now be rejected during binding.
Does Struts 7.2 support Jakarta EE 11 and Java 25?
Yes, Struts 7.2 adds compilation support for Jakarta EE 11 and the project build now targets Java 25, on top of the Jakarta EE baseline already established in the 7.x line.
This support is additive rather than a forced migration. Most teams running Struts 7.x on Jakarta EE 10 containers such as Tomcat 10 or 11 do not need to change anything to keep running on 7.2. The practical benefit is that teams planning a move to Jakarta EE 11-capable servers or newer JDKs do not need to wait for a future Struts release to start that work, and can validate compatibility against 7.2 now.
In practice, treat this as an enabling change: confirm your application server and any Jakarta EE-aware libraries (Jackson, Jetty, Weld, and similar) are aligned before assuming a smooth jump to a Jakarta EE 11 runtime.
How does Struts 7.2 improve java.time handling in forms and JSON?
Struts 7.2 extends both the core type conversion layer and the JSON plugin to natively understand LocalDate, LocalTime, and OffsetDateTime, removing the need for many of the custom converters teams previously wrote to bridge java.time with Struts form fields and JSON payloads.
Concretely:
- The built-in
DateConverternow works withLocalDateandLocalTimeproperties on action classes, in addition to the legacyjava.util.Datesupport. - A new conversion handler covers
OffsetDateTime, useful for APIs that need timezone-aware timestamps. - The JSON plugin gained corresponding
java.timesupport, so REST actions can accept and return these types without bespoke (de)serializers.
This matters if your codebase has accumulated custom TypeConverter implementations or Jackson modules purely to support java.time. Most teams can remove that boilerplate after upgrading, though it is worth keeping the old converters around during testing in case of subtle formatting differences (for example, default ISO-8601 formatting versus a custom pattern your application previously relied on).
What changes to autowiring and parameter authorization need attention before upgrading?
Two changes in Struts 7.2 can alter runtime behavior without any code change on your part, which makes them the highest-priority items for upgrade testing.
First, the autowire alwaysRespect setting now defaults to true. In practice, this affects how Struts resolves Spring-managed beans during autowiring, and applications that relied on the previous default may see different beans injected, or injection failures where none existed before. If your application mixes Spring configuration styles (XML and annotation-based), this is the first place to look if you see unexpected NoSuchBeanDefinitionException or wiring errors after upgrading.
Second, @StrutsParameter enforcement now applies to JSON and REST body deserialization. Any setter that should be populated from a JSON or REST payload needs to be explicitly annotated, for example:
public class UserAction {
private String email;
public void setEmail(String email) {
this.email = email;
}
}
becomes:
public class UserAction {
private String email;
@StrutsParameter
public void setEmail(String email) {
this.email = email;
}
}
Watch out for actions that rely on chained or model-driven objects, since the chaining and chained-property paths are part of the same allowlist tightening in this release. Most teams should run a full regression pass on JSON and REST endpoints after upgrading, paying particular attention to any setter that was relying on implicit allow-by-default behavior.
What other fixes and developer experience improvements landed in Struts 7.2?
Beyond security and Jakarta EE work, 7.2 carries a long list of smaller fixes that mostly affect convention-based projects, interceptor configuration, and template rendering.
- The convention plugin now correctly handles wildcard exclusion patterns for root packages and no longer fails outright when it encounters a
NoClassDefFoundErrorduring action class scanning, which previously could break application startup in environments with optional dependencies on the classpath. HttpMethodInterceptoranddefault-action-refboth received fixes for wildcard-based action names, which is relevant if yourstruts.xmlleans heavily on wildcard mappings.- A classloader and memory leak affecting Tomcat hot deployment has been resolved, which matters for teams that frequently redeploy WAR files without restarting the JVM in staging or development environments.
- The new HTML5 theme gives UI tag users a modern alternative to the long-standing
xhtmlandsimplethemes, with its own test suite. - FreeMarker templates can now use configurable whitespace stripping and a
compresstag, useful for reducing rendered page size without hand-trimming templates. - The JSON plugin now supports configurable request size limits, giving teams a built-in way to cap payload sizes instead of relying solely on container-level settings.
None of these individually require code changes, but the convention plugin and interceptor fixes are worth a quick review if your application has worked around any of these issues with custom code, since that workaround code may now be redundant or conflict with the fix.
Frequently Asked Questions about Apache Struts 7.2
Is Apache Struts 7.2 a major version upgrade from Struts 7.1?
No, Struts 7.2 is a feature release within the existing 7.x line and does not introduce a new Jakarta EE baseline by itself.
Do I need to add StrutsParameter annotations to my action setters before upgrading to Struts 7.2?
Yes, if your actions are populated from JSON or REST request bodies, any setter that should accept incoming data needs the at StrutsParameter annotation, for example public void setEmail(String email) marked with at StrutsParameter, otherwise Struts 7.2 will reject that parameter during binding.
Does Struts 7.2 require Jakarta EE 11 to run?
No, Jakarta EE 11 support in 7.2 is additive, and existing applications running on Jakarta EE 10 compatible servers continue to work without changes.
What should I check after the autowire alwaysRespect default changed to true?
Review any Spring bean wiring used by your actions, since this change can alter which bean Struts resolves during autowiring and may surface previously hidden wiring ambiguities, especially in applications mixing annotation based and XML based Spring configuration.
Can I upgrade directly from Struts 7.0 to 7.2?
Most applications can move directly from 7.0 to 7.2, but you should review the security related parameter authorization changes introduced across the 7.1 and 7.2 releases, since these affect REST, JSON, and cookie based parameter handling regardless of which intermediate version you skip.
Are any plugins or APIs removed in Struts 7.2?
Struts 7.2 removes the deprecated sanitizeNewlines method and marks ReflectionContextFactory as deprecated in favor of ActionContext, so code referencing either of these should be updated during your upgrade testing.