Difference Between Spring MVC and Spring Boot

Written by sandeep-pandey | Published 2020/06/18
Tech Story Tags: spring-boot | spring-mvc | java | microservices | mvc | springboot | backend | api

TLDR DispatcherServlet is the servlet that controls the flow of a request from view to controller. Since Spring 3.1, the Servlet 3 API is supported and we no longer need web.xml for configuring. Spring Boot requires no configuration; it is used to create production-ready applications with zero XML configuration in your project. It wraps all dependencies under spring-boot-started-web, comes with an embedded server, and can be packaged as a jar. It is well-suited for container based development and deployment of microservices.via the TL;DR App

Spring MVC is a framework that is used to build web applications. It follows the Model View Controller patternDispatcherServlet is the servlet that controls the flow of a request from view to controller. Since Spring 3.1, the Servlet 3 API is supported and we no longer need web.xml for configuring DispatcherServlet – instead, it is configured programmatically.
We implement a class with the WebApplicationInitializer interface and add the onStartup() method to add DispatcherServlet to ServletContext.
The @Controller annotation on class name declares this class as a Spring bean, and the @RequestMapping annotation declares that this class is the default handler for all requests of type ‘/’.
Spring Boot requires no configuration; it is used to create production-ready applications with zero XML configuration in your project. We don’t need a deployment descriptor, web server, etc.
It wraps all dependencies under spring-boot-started-web, comes with an embedded server, and can be packaged as a jar. 
@SpringBootApplication is the @Configuration, @EnableAutoConfiguration, and @ComponentScan annotations combined and configured with their default attributes.
Spring boot, which is built on Spring, is easy to learn and comes with built-in features that reduce the learning curve. It is well-suited for container based development and deployment of microservices.

Published by HackerNoon on 2020/06/18