Spring Version 4
- Spring Framework 4.0 provides support for several Java 8 features
- Java EE version 6 or above with the JPA 2.0 and Servlet 3.0 specifications
- Groovy Bean Definition DSL- external bean configuration using a Groovy DSL
- Core Container Improvements
- The @Lazy annotation can now be used on injection points, as well as on @Bean definitions.
- The @Description annotation has been introduced for developers using Java-based configuration
- Using generics as autowiring qualifiers
- Beans can now be ordered when they are autowired into lists and arrays. Both the @Order annotation and Ordered interface are supported.
- A generalized model for conditionally filtering beans has been added via the @Conditional annotation
Spring Version 5
- Functional programming with Kotlin
- Reactive Programming Model.The Reactive Streams API is officially part of Java 9. In Java 8, you will need to include a dependency for the Reactive Streams API specification.
- @Nullable and @NotNull annotations will explicitly mark nullable arguments and return values. This enables dealing null values at compile time rather than throwing NullPointerExceptions at runtime.
- Spring Framework 5.0 now supports candidate component index as an alternative to classpath scanning..Reading entities from the index rather than scanning the classpath.Loading the component index is cheap. Therefore the startup time with the index remains constant as the number of classes increase. While for a compoent scan the startup time increases significantly.
- requires Java 8 as a minimum JDK version.Spring 5 is fully compatible with Java 9.
- Servlet 3.1,JMS 2.0,JPA 2.1,Hibernate5,JAX-RS 2.0,Bean Validation 1.1,JUnit 5