Spring Boot x Spring MVC

Asked

Viewed 4,257 times

5

Spring Boot is the same thing as Spring MVC?

In practice no longer use Spring MVC (or, should not use) and only Spring Boot?

2 answers

7


  • Spring MVC is a structure MVC complete based on HTTP managed by Spring Framework and based on Servlets. It would be equivalent to JSF in the pile JavaEE. The most popular elements in it are classes with the @Controller which you implement methods you can access using different HTTP requests. It has an equivalent @RestController to implement Apis based on REST.
  • Spring boot is a utility to quickly configure applications, offering an "out-of-the-box" setting to create applications with Spring. As you may know, Spring integrates a wide range of different modules into its portfolio , as spring-core , spring-data , spring-web and so on. With this tool, you can quickly use and configure various modules according to your need

So we can say that

Spring MVC is a framework to be used in web applications

and

Spring boot is an initiator of production-ready projects

Another important observation is that Spring Boot can use Spring MVC. To do this, simply import the jar from Spring-boot-starter-web, He’s already self-confident and ready to use. When you do this, basically, you’re talking about using Spring Boot or manually configuring the Spring Application. Spring boot is just autoconfiguration tool, Spring mvc is a web structure

  • To learn spring boot, I first need to learn spring mvc?

  • Not necessarily, actually, I would recommend you to study the spring-boot, as you will be able to learn the other spring modules part by part and as needed, and of course you will get to spring-mvc, at this link has an article showing the development with spring-boot and spring-mvc.

0

Spring MVC and Spring Boot have different purposes, one is to render html pages and work with http protocol within code (this would be Spring MVC). And the other the Spring boot is a project for pivotal to be able to build quickly java applications for microservices, so it is used inside the Spring boot the Spring MVC. It can be a bit confusing since Spring Boot has an http server inside, and when someone talks at http it may be that they are referencing Spring Boot, but that literally helps to execute http operations inside the java code is Spring MVC.

NOTE: Just be careful that the Spring MVC does not have the part of the Observer described in the standard, so it is not the complete standard. :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.