Spring 5 Tutorial

In this Spring 5 Tutorial, learn new features and hello world example with Java annotation configuration.

1. What’s new in Spring 5?

Spring 5 is the first major release, almost four years after Spring Framework 4.0. During this time, most of the enhancements were done in Spring boot project. In Spring 5, these are some exciting features worth mention –

  • Baseline upgrades – Spring 5 now supports minimum JDK 8 and Java EE 7. There are few more libraries for which minimum supported versions have been increased. For example – Servlet 3.1, JMS 2.0, JPA 2.1, JAX-RS 2.0, Bean Validation 1.1, Hibernate 5, Jackson 2.6, EhCache 2.10, JUnit 5 and Tiles 3.

    Minimum supported version for servers have also gone up. For example – Tomcat 8.5, Jetty 9.4, WildFly 10 etc.

  • JDK 9 runtime compatibility – Spring 5 supports Java 9, including Java modules.
  • Usage of JDK 8 features – Spring 5 has baseline version 8, so it uses many new features of Java 8 and 9 as well. In fact, it has pretty extensive use of lambda functions.
  • Reactive programming support – Spring Framework 5 embraces Reactive Streams (language-neutral attempt to define reactive APIs) and Reactor (java implementation of Reactive Streams provided by the Spring Pivotal team) for its own reactive use as well as in many of its core APIs.
  • A functional web framework – Spring 5 also provides a functional web framework. It provides features to define endpoints using functional programming style.
  • Kotlin support – Spring framework 5.0 has good support for Kotlin.

Read More: Spring 5 New Features

2. Spring 5 Examples

List of Spring 5 examples and tutorials.

2.1. Spring 5 Core

  1. Spring Bean Java Config Example
  2. Spring Bean XML Config Example
  3. Spring Bean Eager vs Lazy Initialization
  4. Spring bean scopes

2.2. Spring 5 WebMVC

  1. Spring @GetMapping and @PostMapping Example
  2. Spring DispatcherServlet Tutorial
  3. Spring 5 MVC + Hibernate 5 Example

2.3. Spring Security 5

  1. Security Java Config – @EnableWebSecurity Example
  2. Login Form Example
  3. Spring CORS Configuration

3. Spring 5 tutorial resources

Spring Reference
Spring Security 5
Spring WebMVC

Was this post helpful?

Join 7000+ Fellow Programmers

Subscribe to get new post notifications, industry updates, best practices, and much more. Directly into your inbox, for free.

HowToDoInJava

A blog about Java and its related technologies, the best practices, algorithms, interview questions, scripting languages, and Python.