Sunday, February 2, 2014

New Features in Spring Framework 3.x

New Features in Spring Framework 3.x:

  • Java 5 Support - The core API of Spring 3.0 framework is using Java 5, so Java5 or above is required to run Spring 3.0 based applications. Java 5 features such as generics and annotations and varargs can be used in Spring 3.0 Framework based applications. The Spring 3.0 is fully compatible with the JEE1.4 and JEE5.
  • Spring Expression Language (SpEL) - Spring 3.0 introduces Spring Expression Language (SpEL), a powerful expression language that supports querying and manipulating an object graph at runtime. With SpEL, Spring applications can overcome the limitation of using only fixed values in configuration files. It can be used for bean definitions in both XML- and annotation-based configurations.
  • IoC enhancements/Java based bean metadata are introduced - Some of the Spring JavaConfig capabilities have been migrated into the core framework, such as @Configuration, @Bean, @Primary, @DependsOn, @Lazy, @Import and @Value.
  • Declarative model validation using constraint annotations - JSR 303 (Bean Validation) annotations support has been added and validation rules can now be added to beans using annotations such as @NotNull and @Max(23).
  • Comprehensive REST support in Spring MVC - Support for building RESTful servers and clients has been added.
  • Java EE 6 support - Many of the Java EE 6 features such as JPA 2.0 and JSF 2.0 are supported and they work on non-EE 6 containers like Tomcat and J2EE 1.4 app servers.
  • JSR 330 support - The javax.inject annotations introduced by JSR 330 are now supported.
  • Annotation-based formatting - Bean fields can be automatically formatted and converted using annotations such as @DateFimeFormat(iso=ISO.DATE) and @NumberFormat(style=Style.CURRENCY).
  • Support for embedded databases -Support for embedded Java database engines provides by the org.springframework.jdbc.datasource.embedded package (HSQL, H2, and Derby).
  • Object to XML Mapping(OXM)- The Object-to-XML (OXM) mapping functionality from the Spring Web Services project has been moved into the Core Spring Framework (org.springframework.oxm).
  • Support for Hibernate 4.x (Spring 3.1):  org.springframework.orm.hibernate4 package.
  • Support for Servlet 3 based asynchronous request processing (Spring3.1):  The Spring MVC programming model now provides explicit Servlet 3 async support. @RequestMapping methods can return one of:
    • java.util.concurrent.Callable to complete processing in a separate thread managed by a task executor within Spring MVC.
    • org.springframework.web.context.request.async.DeferredResult to complete processing at a later time from a thread not known to Spring MVC — for example, in response to some external event (JMS, AMQP, etc.)
    • org.springframework.web.context.request.async.AsyncTask to wrap a Callable and customize the timeout value or the task executor to use.
  • Spring MVC Test framework (Spring 3.1): First-class support for testing Spring MVC applications with a fluent API and without a Servlet container. Server-side tests involve use of the DispatcherServlet while client-side REST tests rely on the RestTemplate.
  • Refined Java SE 7 / OpenJDK 7 support (Spring 3.2): Spring Framework 3.2 comes with refined Java 7 support within the framework as well as through upgraded third-party dependencies: specifically, CGLIB 3.0, ASM 4.0