Struts 2.1 Released
The latest version of the Struts2 framework, version 2.1, has just been released. This release marks a significant upgrade, with changes being focused on refactoring more code into the plug-in framework, reducing XML configuration by adding a conventions plug-in, and improving REST support.
I caught up with Musachy Barroso, one of the committers who has been helping to get this release out, to answer some questions:
What are the big differences between 2.0 and 2.1?
Many bugs were fixed in 2.1 (in Struts and Xwork). There are new plugins in 2.1 that push Struts 2 on the direction we want it to go, like REST, Convention and the Java Templates.
A lot of features have moved to plug-ins, can comment on why this was done?
The idea is to leave just "core" functionality in struts-core, and move anything else into plugins. This makes easier to maintain the code base and drop things that will not longer be supported, like the Dojo plugin for example. These changes don't bring any advantages for the users, except a small Struts footprint, if they are not using the mentioned plugins.
Can you talk about why the ajax tags have been depreciate?
Struts 2 Ajax tags are based on Dojo 0.4.x, and porting them to the latest Dojo version would mean a complete rewrite. Dojo has proven to be hard to keep up with, as new versions come out very often and the code changes a lot between even minor versions. Users often end up using straight Dojo, because the tags do not have all the functionality that Dojo offers. All these reason, and the lack of volunteers willing to work with the Dojo tags have forced us to deprecate the Ajax tags.
Why did the codebehind plug-in become the convention plug-in, and what new features it introduces
Convention was developed by Brian Pontarelli as an external project and was later brought into Struts.Convention has a better and faster classpath scanner, supports more configuration elements, better logging, many configuration options, configuration reloading and it is better documented.
What is the java templates plugin?
The Java Templates Plugin is a drop in implementation of the "simple theme" using just Java (the standard implementation uses FreeMarker). The tags in this plugin are 4 to 5 times faster than the standard ones, with the drawback that they cannot be overwritten.
With so many other web frameworks available, why do you think developers should choose struts2?
Struts 2 is probably the most loosely-coupled framework available. Out of the box, many features are usable with little or no customization and it is easy to learn. The same knowledge can then be applied to add plugins to override default behaviors. The loose coupling also allows business logic to be written with no knowledge of the existence of Struts. Despite this, Struts scales up really well and is currently powering some very high-traffic sites.
Anything else you want to add?
Struts 2.1 has taken a long time, but we have worked hard to improve the build and release process, so releases can be expected more often in the future.
Struts 2.1.6 can be downloaded from http://struts.apache.org/2.1.6/index.html.
Problem with Sitemesh
Ronald de Leon
Re: Problem with Sitemesh
Did they update bundled FreeMarker?
Caitie McCaffrey Apr 24, 2015