Adding dependency for Spring MVC

Let's start with adding the Spring MVC dependency to our pom.xml. The following code shows the dependency to be added in. Since we are using Spring BOM, we do not need to specify the artifact version:

    <dependency>       <groupId>org.springframework</groupId>       <artifactId>spring-webmvc</artifactId>     </dependency>

DispatcherServlet is an implementation of the Front Controller pattern. Any request to Spring MVC will be handled by the Front Controller, that is, DispatcherServlet.

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.