Spring 4.0 is the Java 8-enabled latest release of the Spring Framework. In this chapter, we'll discover the major changes in the Spring 4.x release and the four important features of the Spring 4 framework. We will cover the following topics in depth:
@RestController
AsyncRestTemplate
This section deals with the new features and enhancements in Spring Framework 4.0. The following are the features:
java.time
. Spring 4 supports JDK 6 as the minimum.@Order
annotation and the Ordered
interface are supported.@Lazy
annotation can now be used on injection points as well as on the @Bean
definitions.@RestController
annotation. We will discuss this in detail in the following section.AsyncRestTemplate
feature (class) is added for asynchronous REST client development.SocketUtils
class is added to examine the free TCP and UDP server ports on localhost.org.springframework.mock.web
package are now based on the Servlet 3.0 specification.@Conditional
annotation has been added to conditionally enable or disable an @Configuration
class or even individual @Bean
methods.test
module, SQL script execution can now be configured declaratively via the new @Sql
and @SqlConfig
annotations on a per-class or per-method basis.You can visit the Spring Framework reference at http://docs.spring.io/spring/docs/4.1.2.BUILD-SNAPSHOT/spring-framework-reference/htmlsingle/#spring-whats-new for more details.
Also, you can watch a video at http://zeroturnaround.com/rebellabs/spring-4-on-java-8-geekout-2013-video/ for more details on the changes in Spring 4.
3.129.22.164