InfoQ

News

Struts 2.1 Released

Posted by Ian Roughley on Feb 02, 2009

Community
Java
Topics
Web Frameworks
Tags
Struts

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 by Ronald de Leon Posted Feb 2, 2009 1:22 PM
Re: Problem with Sitemesh by Philip Luppens Posted Feb 3, 2009 1:05 AM
Did they update bundled FreeMarker? by Attila Szegedi Posted Feb 3, 2009 7:29 AM
Re: Did they update bundled FreeMarker? by Philip Luppens Posted Feb 3, 2009 9:56 AM
  1. Back to top

    Problem with Sitemesh

    Feb 2, 2009 1:22 PM by Ronald de Leon

    Hi, I've tried using it but I experience having an infinite loop in the interceptors when used with sitemesh. The application is perfectly working with struts 2.0.x but having the said problem with 2.1.6.

  2. Back to top

    Re: Problem with Sitemesh

    Feb 3, 2009 1:05 AM by Philip Luppens

    Please post those issues on the Struts user mailing list, it'll be much easier to find a solution over there. There are lots of projects using Sitemesh & Struts 2.1.x (including a couple of mine), and we haven't encountered such a problem yet.

  3. Back to top

    Did they update bundled FreeMarker?

    Feb 3, 2009 7:29 AM by Attila Szegedi

    I wonder if they finally updated the bundled FreeMarker JAR... Previous Struts shipped with a four year old 2.3.8 FreeMarker (current one is 2.3.15)

  4. Back to top

    Re: Did they update bundled FreeMarker?

    Feb 3, 2009 9:56 AM by Philip Luppens

    We did - in 2.1.5 (pre-GA) we're using 2.3.13. I'm not sure we've updated to the latest one though.

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.