为什么 Struts 2 依赖springframework?
Why does Struts 2 depend on springframework?
我下载了最新版本的 Struts 2 来升级我们当前的 jar 集,看着 Struts 2 附带的庞大的 jar 列表,我只想包括那些这是真正需要的。
我查看了 Struts 2 dependency tree and the Struts 2 compile dependencies,但我无法理解它们对我的应用程序的意义。我不 认为 我们在 org.springframework
中使用任何东西(进行工作区范围内的搜索),但这足以知道我们是否可以排除那些罐子吗?
是不是看上面第2个link的compile dependencies table的"optional"栏那么简单?在可选的那些中,你怎么知道什么时候需要它们,什么时候不需要?还有很多....
它不依赖于 spring 框架。
勾选here
Step 3 - Add Struts 2 Jar Files To Class Path
查看 strtus2 项目所需的最低库。
Struts2 项目对 Spring 框架具有编译依赖性。但这并不意味着您的项目需要 spring 框架 jar。正如您提到的,这些依赖项是 optional. It means they are required if you use some features of Struts2 that depend directly on Spring. You can use Maven to resolve dependencies for your project's pom.xml
. If you want to view/analize a dependency tree you can use eclipse m2eclipse plugin. Analogous visualization tools available in other IDEs. The same as invoking manually mvn dependency:tree
。
Struts2 仅将 spring 框架用于构建期间的测试和编译。
除此之外,只有 Struts2 Spring plugin 依赖于 spring 框架。
如果您不使用此插件,您的项目中不应有任何 spring 依赖项。
struts2 由于一些不错的核心特性而依赖于 spring 框架。
依赖注入和 AOP 是 spring 框架和 struts2 广泛使用的功能。
虽然 struts2 框架包含丰富的 UI 和 MVC 视图,但这些是使 struts2 依赖于 spring 的组件。
Spring 框架的安全功能,JDBC,事务管理是另一个可以与 struts2 一起使用的模块。
谢谢,
阿米特·库马尔
Struts2 对 Spring 没有任何依赖性。但是,当您查看 struts 2 库时,它包含 Spring 相关的 jar。这样做是为了添加额外的支持以集成 Struts 和 Spring 并使用很好的 features/modules of Spring 像 DI,AOP,事务等。它是完全可选的排除那些罐子并继续使用传统的 Struts 框架。此外,由于 struts 没有增量开发,例如将 struts 3 推向市场。前进的方向是将 struts 与 Spring 整合。
我下载了最新版本的 Struts 2 来升级我们当前的 jar 集,看着 Struts 2 附带的庞大的 jar 列表,我只想包括那些这是真正需要的。
我查看了 Struts 2 dependency tree and the Struts 2 compile dependencies,但我无法理解它们对我的应用程序的意义。我不 认为 我们在 org.springframework
中使用任何东西(进行工作区范围内的搜索),但这足以知道我们是否可以排除那些罐子吗?
是不是看上面第2个link的compile dependencies table的"optional"栏那么简单?在可选的那些中,你怎么知道什么时候需要它们,什么时候不需要?还有很多....
它不依赖于 spring 框架。
勾选here
Step 3 - Add Struts 2 Jar Files To Class Path
查看 strtus2 项目所需的最低库。
Struts2 项目对 Spring 框架具有编译依赖性。但这并不意味着您的项目需要 spring 框架 jar。正如您提到的,这些依赖项是 optional. It means they are required if you use some features of Struts2 that depend directly on Spring. You can use Maven to resolve dependencies for your project's pom.xml
. If you want to view/analize a dependency tree you can use eclipse m2eclipse plugin. Analogous visualization tools available in other IDEs. The same as invoking manually mvn dependency:tree
。
Struts2 仅将 spring 框架用于构建期间的测试和编译。
除此之外,只有 Struts2 Spring plugin 依赖于 spring 框架。
如果您不使用此插件,您的项目中不应有任何 spring 依赖项。
struts2 由于一些不错的核心特性而依赖于 spring 框架。 依赖注入和 AOP 是 spring 框架和 struts2 广泛使用的功能。 虽然 struts2 框架包含丰富的 UI 和 MVC 视图,但这些是使 struts2 依赖于 spring 的组件。 Spring 框架的安全功能,JDBC,事务管理是另一个可以与 struts2 一起使用的模块。
谢谢, 阿米特·库马尔
Struts2 对 Spring 没有任何依赖性。但是,当您查看 struts 2 库时,它包含 Spring 相关的 jar。这样做是为了添加额外的支持以集成 Struts 和 Spring 并使用很好的 features/modules of Spring 像 DI,AOP,事务等。它是完全可选的排除那些罐子并继续使用传统的 Struts 框架。此外,由于 struts 没有增量开发,例如将 struts 3 推向市场。前进的方向是将 struts 与 Spring 整合。