Home  >  Spring 4

Spring 4 New Features and Enhancement

By Arvind Rai, August 01, 2014
On this page I have provided new feature and enhancement in Spring 4. Spring 4 has provided many new classes and also has deprecated some old classes. In Core container, Test module etc there are enhancement in Spring 4. Find the point wise description.

1. Java 8 Support : In Spring Framework 4 java lambda expression has been supported. The package java.time of java 8 is supported efficiently. Leaving some java 8 features, Spring 4 support JDK 6 as minimum.

2. Servlet 3.0 is Strongly Recommended for Spring 4: Java EE version 6 and 7 is the base of spring 4 which is based on JPA 2 and Servlet 3.0.

3. Hibernate 4.3 Support: Hibernate 4.3 is only supported by Spring 4.
Generic types as a form of qualifier: In spring 4, generic types can be considered as a form of qualifier. You can autowire a bean as below
Repository<Student> studentRepository. 

4. Spring 4 supports to develop custom annotation

5. If we autowire list and arrays, then bean containing in these collection can be ordered.

6. In spring 4, @Lazy annotation can be used at injection label too.

7. For REST application, spring 4 provides new @RestController annotation. Before this, each rest web service method need to be annotated with @ResponseBody. Now if you use @RestController at class level then we do not need to use @ResponseBody.

8. In spring 4, AsyncRestTemplate class has been added for REST development.

9. In Spring 4 MVC, different time zone has been supported.

10. New modules has been added

a. spring-websocket : Helps the two way communication between client and server.

b. spring-messaging: This modules supports STOMP.

11. In spring-test, now in spring 4, all annotations can be used to create custom composed annotations.

12. In spring- test, custom ActiveProfilesResolver , can be implemented to resolve active bean definitions programmatically.

13. A class SocketUtils has been introduced to get TCP and UDP server port.

14. All the mocks org.springframework.mock.web is based on Servlet 3.0 in spring 4.


What's New in Spring Framework 4.x

Migrating from Spring Framework 3.2 to 4.0.1

©2022 concretepage.com | Privacy Policy | Contact Us