Spring MVC和Spring Boot之间的区别 [英] Difference between Spring MVC and Spring Boot
问题描述
我刚刚开始学习Spring.在下一步中,我想开发更大的Web应用程序.
I have just started learning Spring. In my next step, I would like to develop bigger web applications.
现在我想知道应该从Spring Boot还是Spring MVC开始.我已经读过一些东西,但是令人困惑,因为两者看起来很相似.
Now I am wondering if I should start with Spring Boot or Spring MVC. I have already read some stuff, but it is confusing because both look similar.
那么两者之间有什么区别?
So what are the differences between the two?
推荐答案
- Spring MVC 是由Spring框架管理并基于Servlet的完整的HTTP面向MVC框架.它相当于JavaEE堆栈中的JSF.最受欢迎
其中的元素是用
@Controller
注释的类, 在其中实现可以使用不同的HTTP请求访问的方法.它具有等效的@RestController
来实现基于REST的API. - Spring boot 是用于快速设置应用程序的实用程序,提供开箱即用的配置以进行构建 弹簧驱动的应用程序.如您所知,Spring集成了 保护伞下的各种不同模块,如 spring-core ,弹簧数据, spring-web (顺便说一下,它包括Spring MVC)等等.借助此工具,您可以告诉Spring要使用的数量,并且可以快速设置它们(以后您可以自行更改).
- Spring MVC is a complete HTTP oriented MVC framework managed by the Spring Framework and based in Servlets. It would be equivalent to JSF in the JavaEE stack. The most popular
elements in it are classes annotated with
@Controller
, where you implement methods you can access using different HTTP requests. It has an equivalent@RestController
to implement REST-based APIs. - Spring boot is a utility for setting up applications quickly, offering an out of the box configuration in order to build Spring-powered applications. As you may know, Spring integrates a wide range of different modules under its umbrella, as spring-core, spring-data, spring-web (which includes Spring MVC, by the way) and so on. With this tool you can tell Spring how many of them to use and you'll get a fast setup for them (you are allowed to change it by yourself later on).
因此,Spring MVC是要在Web应用程序中使用的框架,而Spring Boot是基于Spring的 production-ready 项目初始化程序.您可能会发现访问 Spring MVC标签Wiki 和
So, Spring MVC is a framework to be used in web applications and Spring Boot is a Spring based production-ready project initializer. You might find useful visiting the Spring MVC tag wiki as well as the Spring Boot tag wiki in SO.
这篇关于Spring MVC和Spring Boot之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!