Spring Boot x Spring MVC [duplicate]

3

Is Spring Boot the same as Spring MVC?

In practice, do not you use Spring MVC (or, should not you use it) and only Spring Boot?

    
asked by anonymous 02.06.2017 / 05:21

2 answers

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

So, we can say that

  

Spring MVC is a framework to be used in Web applications

and

  

Spring boot is a boot projects ready for production

Another important note is that Spring Boot can use Spring MVC . To do this, just import the Spring-boot-starter-web jar, it is already autoconfigured and ready to use. When you do this, you're basically talking about using Spring Boot or manually setting Spring Application. Spring boot is just an autoconfiguration tool, Spring mvc is a web framework

    
02.06.2017 / 05:54
0

Spring MVC and Spring Boot have different purposes, one is to render html pages and work with the http protocol inside the code (this would be Spring MVC). And the other Spring boot is a project to do by pivotal so that you can quickly build java applications for microservices, so it is used inside the Spring boot the Spring MVC. It may be a bit confusing since Spring Boot has an http server inside, and when someone talks in http it might be referencing Spring Boot, however that literally helps to perform http operations inside the java code is Spring MVC. p>

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

    
09.12.2017 / 20:47