Spring MVC 和 Spring Boot 的区别 [英] Difference between Spring MVC and Spring Boot

查看:40
本文介绍了Spring MVC 和 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 是一个完整的面向 HTTP 的 MVC 框架,由 Spring Framework 管理并基于 Servlets.它相当于 JavaEE 堆栈中的 JSF.最受欢迎其中的元素是用 @Controller 注释的类,您可以在其中实现可以使用不同 HTTP 请求访问的方法.它有一个等效的 @RestController 来实现基于 REST 的 API.
  • Spring boot 是一种用于快速设置应用程序的实用程序,提供开箱即用的配置以构建Spring 驱动的应用程序.您可能知道,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 的生产就绪项目初始值设定项.您可能会发现访问 Spring MVC 标签维基 以及 Spring Boot 标签 wiki 在 SO 中.

      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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆