What Is New in Apache Struts 6.0
Struts 6.0 is a major release that modernizes the framework by aligning it with the latest Java ecosystem standards. The core focus is on upgrading dependencies and removing legacy components that are no longer supported. This version requires a minimum of Java 11 to run.
| Category | Key Changes |
|---|---|
| Java Version | Requires Java 11+ |
| New Features | Support for Jakarta EE 9+ (namespace change to jakarta.*) |
| Improvements | Updated dependencies (Logging, Bean Validation, Tiles) |
| Removed | Support for Java 8, deprecated plugins (JSON, REST, Embedded JSP) |
Why did Struts move to Jakarta EE 9?
The framework has been updated to use Jakarta EE 9 and above. This is the most significant change, as it moves all Jakarta artifacts from the old javax.* namespace to the new jakarta.* namespace.
In practice, this means your existing code that uses imports like javax.servlet will need to be updated to jakarta.servlet to be compatible with Struts 6.0. This change was necessary to follow the new path set by the Eclipse Foundation for the Java EE ecosystem.
What dependencies were updated in Struts 6?
Several key dependencies have been upgraded to their latest major versions to ensure compatibility with Jakarta EE 9. The OGNL library has been updated to version 3.3.4, and Apache Commons BeanUtils has been updated to version 1.9.4.
Additionally, the framework now uses Tiles 3.0.10 and Jakarta Bean Validation 3.0. These updates provide better performance and security while maintaining the core functionality Struts developers expect.
Which plugins and features were removed?
Support for the JSON plugin, REST plugin, and Embedded JSP plugin has been completely removed from the core distribution. These plugins were already deprecated in earlier versions and have now been taken out.
The removal streamlines the framework. If you were relying on these, you'll need to find alternative solutions or maintain your own custom implementations for that functionality.
FAQ
Is Struts 6.0 backwards compatible with my Struts 2.x application?
No, it is not directly backwards compatible. The move to the jakarta.* namespace means you must update all your imports from javax.* to jakarta.* in your actions, filters, and JSP pages. This is a breaking change.
Can I run Struts 6.0 on Java 8?
No. Struts 6.0 requires a minimum of Java 11. This aligns the framework with the current long-term support (LTS) version of Java and allows the use of newer language features.
What happened to the Struts REST plugin?
The REST plugin, along with the JSON and Embedded JSP plugins, has been removed. They were officially deprecated in previous releases and are no longer included in the core distribution. You'll need to handle REST APIs with alternative methods.
How do I handle logging with the updated Log4j dependency?
Struts 6.0 uses Log4j 2.17.2. You should configure your log4j2.xml accordingly. In practice, this version addresses known security issues, so it's a crucial update for production environments.
Where can I find the updated DTDs for my configuration files?
The DTDs have been moved to a new location. You should update the references in your struts.xml and other configuration files to point to the latest versions available on the Apache Struts website to avoid any validation issues.