© Marten Deinum 2018
Marten DeinumSpring Boot 2 Recipeshttps://doi.org/10.1007/978-1-4842-3963-6_3

3. Spring MVC

Marten Deinum1 
(1)
Meppel, Drenthe, The Netherlands
 

Spring Boot will automatically configure a web application when it finds the classes on the classpath. It will also start an embedded server (by default it will launch an embedded Tomcat)1

3.1 Getting Started with Spring MVC

Problem

You want to use Spring Boot to power a Spring MVC application.

Solution

Spring Boot will do auto-configuration for the components needed for Spring MVC. To enable this, Spring Boot needs to be able to detect the Spring MVC classes on its classpath. For this you will need to add the spring-boot-starter-web as a dependency.

How It Works

In your project, add the dependency ...

Get Spring Boot 2 Recipes: A Problem-Solution Approach now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.