- Released in December 2013
Version 4.0 is the latest major release of the Spring Framework and the first to fully support Java 8 features. You can still use Spring with older versions of Java, however, the minimum requirement has now been raised to Java SE 6.
Spring 4.0 Features
- JSR-335 Lambda expressions
- JSR-310 Date-Time value types for Spring data binding and formatting.
- JSR-343 JMS 2.0.
- JSR-338 JPA 2.1.
- JSR-349 Bean Validation 1.1.
- JSR-236 Java EE 7 Enterprise Concurrency support.
- JSR-356 Spring’s WebSocket endpoint mode.
- Configuring and implementing Spring style application using Groovy 2. Also they specify that first class support for the Groovy applications.
- Also spring plans to add the HATEOS (Hypermedia as the Engine of Application State) support for REST APIs.
An important feature to highlight in Spring4.0 is the @RestController annotation to support REST API’s .
@RestController annotation is inherited from the @Controller annotation. Prior to the version 4.0, all the Spring MVC components has to use the common @Controller annotation to mark that as the controller servlet. When you implement a RESTful web services, the response would be always sent with the response body. To make this simple, Spring 4.0 has provided a specialized version of controller.
Here is the definition of the @RestController implementation.
Spring docs says:
A convenience annotation that is itself annotated with @Controller and @ResponseBody. Types that carry this annotation are treated as controllers where @RequestMapping methods assume @ResponseBody semantics by default.
@ResponseBody – As of version 4.0 this annotation can also be added on the type level in which case is inherited and does not need to be added on the method level.
SPRING 3.0, 3.1, 3.2
- Spring 3.0 was first released in December 2009.
- Spring 3.1 followed in December 2011.
- Spring 3.2.2 was released in March 2013. Along with this announcement is the release of Spring Framework 3.2.3, containing bug fixes and OpenJDK 8 runtime support.
Java SE and Java EE Support
The Spring Framework is now based on Java 5, and Java 6 is fully supported.
Furthermore, Spring is compatible with J2EE 1.4 and Java EE 5, while at the same time introducing some early support for Java EE 6.
This is a list of new features for Spring 3.0.
- Spring Expression Language
- IoC enhancements/Java based bean metadata
- General-purpose type conversion system and field formatting system
- Object to XML mapping functionality (OXM) moved from Spring Web Services project
- Comprehensive REST support
- @MVC additions
- Declarative model validation
- Early support for Java EE 6
- Embedded database support
The first milestone release of Spring 3.1 has the following features
- Bean definition profiles
- Unified property management through Spring’s new
- Enhancements to Java-based configuration with
- Expanded MVC namespace support and a Java-based configuration equivalent
- Streaming support and new interception model for the
- Comprehensive caching support
c:XML namespace for concise configuration of constructor injection
And a lot more. please go through the below links:
Spring 3.2 features
- Spring MVC Test Framework
- Asynchronous MVC processing on Servlet 3.0
- custom @Bean definition annotations in @Configuration classes
- @Autowired and @Value to be used as meta-annotations
- Concurrency refinements across the framework
- loading WebApplicationContexts in the TestContext framework
- JCache 0.5 (JSR-107)