Spring Source pushed the first release candidate of Spring 3 a little more than a month ago; it took a little longer than expected, but nonetheless I've been waiting on this release to play around with the new Portlet MVC features.

For portlet developers, the most notable enhancements are in the support for the Portlet 2.0 spec (JSR286), primarily offered through a new set of portlet-specific annotations. There are also various enhancements to Spring Core and Web MVC that will be useful on portal projects and standard java web projects.

I've built an example portlet application to show off some of these new features; it's downloadable below as a deployable WAR (tested on JBoss Portal 2.7.2) and a mavenized eclipse project (zip).

Highlights

New Portlet 2.0 Annotations

Spring 3 has several new annotations for JSR286; I've used the @RenderMapping, @ActionMapping, and @ResourceMapping annotations in the example application.

See: ToDoListController.java

Bean Validation Integration

Spring 3 now has built in support for the Bean Validation specification (JSR303). In the example, I've used the javax.validation annotations on the ToDo model object which is automatically validated after binding with the@Valid annotation.

See: ToDo.java, ToDoListController.java.

Formatter API

In an effort to align with Spring Web Flow, Spring 3 appears to be moving away from the PropertyEditor approach to the Formatter API for custom binders.

See: the dateFormatter configuration in applicationContext.xml.

Expression Language in Bean Definitions

Available in the past with springmodules (PropertyPlaceholderConfigurer), Spring Core now has the ability to reference other beans with expression language inside applicationContext configuration.

See: the dateFormatter configuration in applicationContext.xml.


Conclusion

Spring has taken a big step forward with Spring 3, implementing changes inspired by Spring Webflow (binding, Formatter API), springmodules (validation, EL bean references in applicationContext config), and other projects like Bean Validation (JSR303) and DI for Java (JSR330). If Spring continues to make progress toward and integrate well with open projects like these, I think Spring Portlet MVC will stay a pretty compelling option for portlet development.

Also, a side note: after reading around, it looks like the older, MVC class hierarchy method for developing portlet and web mvc controllers will be deprecated with this or a near future release. I think this is a positive direction for the framework, as we've seen a good increase in producitivity and lower complexity with annotation driven controllers.