What Is New in Apache Struts 2.3
This release brings the framework up to speed with modern Java versions and introduces key enhancements to its core components. You'll find better Java 7 support, a new plugin system, and important internal upgrades.
| Category | Key Changes |
|---|---|
| New Features | Convention Plugin, Java 7 Support, Enhanced REST Plugin |
| Improvements | Freemarker Upgrade, OGNL Performance, XWork Dependency Update |
| Deprecations | Codebehind Plugin, Deprecated Methods Removal |
| Bug Fixes | Various issues resolved from previous versions |
How does Struts 2.3 handle modern Java development?
The framework now officially supports Java 7, which was a significant step forward at the time. This means you can use features like the diamond operator and try-with-resources within your Struts applications without compatibility headaches.
In practice, this update mattered because it aligned Struts with the JDK versions developers were actually using in production. The internal refactoring to support newer Java versions also helped pave the way for future enhancements.
What changed with plugins in this release?
Struts 2.3 introduced the Convention Plugin as a replacement for the older Codebehind Plugin, which was deprecated. The Convention-over-Configuration approach reduces the amount of XML you need to write by detecting your actions based on naming conventions.
The REST plugin also got significant enhancements, making it more practical for building web services. If you're building APIs with Struts, this version made it much cleaner to handle different content types and HTTP methods.
Were there any template engine improvements?
Yes, Freemarker was upgraded to version 2.3.19. This matters because Freemarker is core to how Struts renders views, and the update brought performance improvements and bug fixes from the Freemarker project itself.
XWork also saw an update to version 2.3.3. Since XWork provides the foundational command pattern framework that Struts builds upon, this upgrade improved overall stability and performance for the entire stack.
What about OGNL expression handling?
OGNL received performance enhancements that made expression evaluation faster. This directly affects how quickly your value stack operations and expression evaluations happen in practice.
They also cleaned up deprecated methods and classes that had been hanging around from older versions. This kind of housekeeping makes the codebase cleaner and helps avoid confusion about which APIs to use.
FAQ
Is the Codebehind Plugin still available in Struts 2.3?
No, it was deprecated in favor of the Convention Plugin. The Convention Plugin uses annotations and naming conventions instead of XML configuration, which most developers find more intuitive.
Can I run Struts 2.3 on Java 6?
While Java 7 is the recommended version, backward compatibility with Java 6 was maintained. However, you won't be able to use the new Java 7 language features if you stick with the older JDK.
What version of Freemarker does Struts 2.3 use?
It uses Freemarker 2.3.19. This was a notable upgrade from previous versions and included various performance improvements and bug fixes from the Freemarker project.
Were there any breaking changes in this release?
Mostly additive changes, but they did remove some deprecated methods. You should check the release notes for specific methods that might affect your codebase if you're upgrading from a much older version.
Did the REST plugin get any new features?
Yes, the REST plugin was enhanced to better handle content negotiation and HTTP method mapping. It became more practical for building full-featured RESTful APIs with Struts.