This section deals with the new features and enhancements in Spring Framework 4.0. The following are the features:
Spring 4 supports Java 8 features such as Java lambda expressions and
java.time
. Spring 4 supports JDK 6 as the minimum.All deprecated packages/methods are removed.
Java Enterprise Edition 6 or 7 are the base of Spring 4, which is based on JPA 2 and Servlet 3.0.
Bean configuration using the Groovy DSL is supported in Spring Framework 4.0.
Hibernate 4.3 is supported by Spring 4.
Custom annotations are supported in Spring 4.
Autowired lists and arrays can be ordered. The
@Order
annotation and theOrdered
interface are supported.The
@Lazy
annotation can now be used on injection points as well as on the@Bean
definitions.For the REST application, Spring 4 provides a new
@RestController
annotation. We will discuss this in detail in the following section.The
AsyncRestTemplate
feature (class) is added for asynchronous REST client development.Different time...