QCon London 2009: Spring 3.0 upcoming features

Rod Johnson, CEO of SpringSource, presented the new features in the upcoming Spring 3.0 release today at the QCon London 2009 conference.

Probably the most important infrastructural change is that from version 3.0, Spring will work only on Java 5+ platforms. The project layout will change slightly, moving to Maven style finer grained system of projects, which will be built using the the new Spring build system (“as known from Spring web flow 2.0”) which is OSGi based.

In terms of new features, Johnson pointed out the following innovations:

  • Expression language for configuration
  • Comprefensive REsT support
  • support for Portlet 2.0
  • Declarative model validation
  • Early support for Java EE 6

Spring expression language

Spring expression parser is the most important new addition in version 3.0, and will be shipped as part of the org.springframrwork.expression package. The Spring expression language is compatible with Unified EL, but according to Johnson does a lot more. You can use it anywhere where you can write a bean definition, for example in the configuration files:

<property name="prop1" value="#{systemProperties.databaseName}" />
<property name="prop2" value="#{strategyBean.databaseName}" />

Expressions can reference global system properties or properties of other beans in the same context. It can also be used in annotations, for example:

class Bean {
@Value ("#systemProperties.favouriteColor}")
private String favouriteColor;

This also applies to method parameter annotations. In addition to beans and system properties, expressions can access various web context properties such as contextProperties, contextAttributes, request, session.

Rest support and MVC changes

Building on annotations in Spring MVC introduced in version 2.5, Spring MVC will get strong REST support. An example of exposing controller methods with REST is:

@RequestMapping(value=/show/{id}", method=GET)
public Reward show(@PathVariable("id") long id){

This will work across different protocols (JSON, ATOM, XML). There will also be new options for handler method parameters, including @ReqestHeader and @CookieValue. People will also be able to use their own annotations and include that into the @RequestMapping support.

Release schedule

Johnson announced that milestone 3 will be released till the end of March, with a release candidate coming out in early May and the general availability release in June.

I’m covering the Qcon London 2009 conference in detail on this blog. Click here for other news and reviews from the conference

I'm Gojko Adzic, author of Impact Mapping and Specification by Example. My latest book is Fifty Quick Ideas to Improve Your Tests. To learn about discounts on my books, conferences and workshops, sign up for Impact or follow me on Twitter. Join me at these conferences and workshops:

Specification by Example Workshops

How to get more value out of user stories

Impact Mapping

Leave a Reply

Your email address will not be published. Required fields are marked *