标题: 【JavaEE】Spring Web MVC [打印本页] 作者: 水军大提督 时间: 2024-11-29 15:53 标题: 【JavaEE】Spring Web MVC
一、Spring Web MVC简介
官方文档介绍:
Spring Web MVC is the original web framework built on the Servlet API and has been included in the Spring Framework from the very beginning. The formal name, “Spring Web MVC,” comes from the name of its source module (spring-webmvc), but it is more commonly known as “Spring MVC”.
Parallel to Spring Web MVC, Spring Framework 5.0 introduced a reactive-stack web framework whose name, “Spring WebFlux,” is also based on its source module (spring-webflux). This chapter covers Spring Web MVC. For reactive-stack web applications, see Web on Reactive Stack.
For baseline information and compatibility with Servlet container and Jakarta EE version ranges, see the Spring Framework Wiki.
翻译:
Spring Web MVC 是基于 Servlet API 构建的原始 Web 框架,从一开始就包含在 Spring 框架中。正式名称“Spring Web MVC”来自其源模块的名称 (spring-webmvc),但更常见的名称是“Spring MVC”。
与 Spring Web MVC 并行,Spring Framework 5.0 引入了一个反应式堆栈 Web 框架,其名称“Spring WebFlux”也基于其源模块 (spring-webflux)。本章介绍 Spring Web MVC。对于反应式堆栈 Web 应用程序,请参阅反应式堆栈上的 Web。
有关 Servlet 容器和 Jakarta EE 版本范围的基线信息和兼容性,请参阅 Spring Framework Wiki。
servlet:
Servlet 是⼀种实现动态⻚⾯的技能. 准确来讲Servlet是⼀套 Java Web 开发的规范,或者说是⼀套 Java Web 开发的技能尺度. 只有规范并不能做任何事情,必须要有⼈去实现它. 所谓实现 Servlet 规范,就是真正编写代码去实现 Servlet 规范提到的各种功能,包括类、⽅法、属性等.
Servlet 规范是开放的,除了 Sun 公司,其它公司也可以实现 Servlet 规范,⽬前常⻅的实现了
Servlet 规范的产品包括 Tomcat、Weblogic、Jetty、Jboss、WebSphere等,它们都被称
为"Servlet 容器". Servlet 容器⽤来管理程序员编写的Servlet 类.
1.1 MVC简介
MVC:
MVC 是 Model View Controller 的缩写,它是软件⼯程中的⼀种软件架构计划模式,它把软件系统分为模型、视图和控制器三个基本部门.