What's New In Struts 1.1
- What's New in Struts 1.1?
- Where Does Struts Go from Here?
- Summary
For JSP and J2EE developers looking for a way to manage the complexity of large web sites, the platform of choice has been Struts. This framework, based on the Model-View-Controller design pattern and part of the Apache Jakarta project, is in use throughout the industry. Struts combines tools for form validation, workflow control, and separation of business logic from display.
After nearly a year of anticipation, Jakarta Struts 1.1 is finally out the door. In reality, however, this release is more like Struts 1.99 or even Struts 2.0 when you get done looking at all the new features and functionality that have been added.
And now that 1.1 is complete, the developers and user community are looking toward the 1.x and 2.0 releases, with a plethora of new features and integrations waiting in the wings. With that in mind, let's look at what's new in 1.1, and what's upcoming in the next few months and year.
What's New in Struts 1.1?
To begin with, the release is much more bulletproof than 1.0.2 was, mainly as a result of the thousands of developers who have been using the 1.1 betas and finding bugs. In addition, the same developers were finding the shortcomings of 1.0 as they deployed Struts as their application framework, and have been adding some sorely needed features.
The following sections briefly describe a few of the key advances found in the Struts 1.1 release.
Navigation Improvements
In 1.1, you can have an action that forwards directly to a JSP page without needing to define an Action class. The html:link tag can specify an action rather than a URI, allowing you to define links that pass through intermediate Actions.
Dynaforms
Dynaforms allow you to define ActionForms directly from the struts-config.xml file, without needing to create an explicit new class. As a result, it's easy to create a new form on the fly, without having to spend a lot of time on bean properties.
Validator Framework
Hand in hand with Dynaforms, the validator framework allows you to define validation logic for forms using XML descriptors rather than having to write a validate() method on an ActionForm. In addition to the predefined validation (which includes length, type, and credit card checks), you can also define your own validations. You can also define field validations that depend on the values of other fields.
Tiles Taglib
Tiles provides a very powerful templating framework that enables you to define common document struts (headers, footers, sidebars) using either JSP documents or XML files. Using Tiles, you can essentially include document content from another file, passing parameters into the document.
Integration with JSTL
As the Java Standard Tag Library becomes more widely adopted, Struts has kept in step by offering tight integration. For example, the struts-el taglib offers versions of most of the Struts tags that can have embedded Expression Language (EL) values in them. For example, the following can generate a computed URL for an HTML link.:
<html-el:link href="${aBean.nextPage}"> Next Page
</html-el:link>
In addition, some of the base Struts tag libraries now have a better understanding of JSTL. For example, the "indexed" property of the Struts HTML form tags can now be wrapped inside a JSTL <c:forEach> loop, as well as in a Struts <logic:iterate> loop.
Integration with JSF
Looking ahead to the Java Server Faces framework, which will be released at the end of the year, Struts included a contributed JSF integration tag library, which will enable developers to begin exploring JSF and working out migration and integration strategies for this new Java Community Process Technology.
And All the Rest...
There have also been countless tweaks and minor improvements throughout the Struts frameworkall designed to improve the usability and reliability of the framework. The best place to look to see the full picture is the 1.1 release notes.