Mah*_*ran 90 spring spring-mvc maven
以下依赖项之间有什么区别?
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
VS
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
如果我spring-webmvc单独包含,则spring-web隐式添加.
什么时候应该spring-web单独使用?
Tom*_*icz 122
spring-web 提供核心HTTP集成,包括一些方便的Servlet过滤器,Spring HTTP Invoker,与其他Web框架集成的基础架构和HTTP技术,例如Hessian,Burlap.
spring-webmvc是Spring MVC的一个实现.spring-webmvc 依赖于上spring-web,因此包括它会传递性增加spring-web.您不必spring-web明确添加.
您应该只依赖于spring-web您是否不使用Spring MVC,而是希望利用Spring支持的其他与Web相关的技术.
来自官方文档: spring-web 模块提供了基本的面向 Web 的集成功能,例如分段文件上传功能以及使用 Servlet 侦听器和面向 Web 的应用程序上下文初始化 IoC 容器。它还包含一个 HTTP 客户端和 Spring 远程支持的 Web 相关部分。
spring-webmvc 模块(也称为 Web-Servlet 模块)包含 Spring 的模型-视图-控制器 (MVC) 和用于 Web 应用程序的 REST Web 服务实现。Spring 的 MVC 框架在域模型代码和 Web 表单之间提供了清晰的分离,并与 Spring 框架的所有其他功能集成。
spring-webmvc-portlet 模块(也称为 Web-Portlet 模块)提供了要在 Portlet 环境中使用的 MVC 实现,并反映了基于 Servlet 的 spring-webmvc 模块的功能。
| 归档时间: |
|
| 查看次数: |
37222 次 |
| 最近记录: |