📜  Java的Spring 与 Struts

📅  最后修改于: 2021-09-12 11:00:36             🧑  作者: Mango

Struts 和 spring 都用于开发Java Web 应用程序。 Struts 的开发早于 Spring,但在 Struts 框架中得到了增强,现在两者都用于使用Java开发 Web 应用程序。

弹簧框架

使用开源 spring 框架可以形成模块化、可移植和可测试的Java应用程序。它是用于开发 Web 应用程序的标准,可以通过 J2EE 又名Java到企业版应用程序使用。这处理基础设施并使代码可重用和可测试,从而提高其性能。它适用于控制 IoC 和依赖注入概念的反转。它还用于减少程序模块之间的耦合。

Spring框架架构

支柱框架

Struts 是一个基于 MVC 架构的框架,代表模型视图和控制器架构。它是一个开源平台,用于开发企业版 Web 应用程序。它有一个请求处理程序和响应处理程序,因为它基于基于请求的框架来处理来自用户的请求。 Struts 支持 AJAX、REST 和 SOAP。

Struts的工作:

Spring 和 Struts 架构的区别

Spring Struts
It is a lightweight framework. It is a heavyweight framework.
It does not support tag library. It supports tag library directive.
It has loosely coupled modules. It has tightly coupled programming modules.
It is integrated with ORM Technologies using which, lesser coding is required after and before the main logic. It supports manual coding.
It has a layered MVC architecture containing 3 layers for modelling, viewing and controller. It does not have a layered architecture.