我希望将我的项目从Struts2改为Spring。
我这么做的动机有两方面:1.我希望我的演示框架能够正确地实现HTML5标记2--我最近从一家使用Struts2而没有Spring的公司被裁掉了,现在我发现我缺乏找到新工作的技能
我首先使用maven原型启动了这个项目(我不记得是哪个),pom已经配置了以下内容:
<properties>
<struts.version>2.3.1</struts.version>
</properties>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${struts.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-json-plugin</artifactId>
<version>${struts.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>${struts.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${struts.version}</version>
</dependency>是的,该项目使用Spring,但只是bean实例化和依赖注入的核心。
我想知道的是:我需要用to替换这些依赖项:维护用Struts 2.3.1打包的sitemesh和spring核心版本?(我已经搜索过'Struts 2.3.1捆绑包‘并获得了这个版本,但没有在'spring’https://struts.apache.org/docs/guides.html旁边获得这个版本)用Spring替换核心插件和剩余插件,我需要用spring来额外依赖JSON支持吗?就像Struts一样?
我意识到,一旦这些内容被替换掉,就会有一项艰巨的任务--重构到Spring。
发布于 2015-09-27 08:46:55
感谢戴夫·牛顿为我指明了正确的方向。
找到答案使用
mvn dependency:tree这表明struts2春季插件由以下部分组成:
+- org.apache.struts:struts2-spring-plugin:jar:2.3.1:compile
| +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
| +- org.springframework:spring-core:jar:3.0.5.RELEASE:compile
| | +- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
| | \- commons-logging:commons-logging:jar:1.1.1:compile
| +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile
| | +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
| | \- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
| +- org.springframework:spring-web:jar:3.0.5.RELEASE:compile
| | \- aopalliance:aopalliance:jar:1.0:compile
| +- commons-lang:commons-lang:jar:2.5:compile
| \- org.apache.struts:struts2-core:jar:2.3.1:compile
| +- org.apache.struts.xwork:xwork-core:jar:2.3.1:compile
| | +- asm:asm:jar:3.3:compile
| | \- asm:asm-commons:jar:3.3:compile
| | \- asm:asm-tree:jar:3.3:compile
| +- org.freemarker:freemarker:jar:2.3.18:compile
| \- ognl:ognl:jar:3.0.3:compile
| \- javassist:javassist:jar:3.11.0.GA:compile所以答案是: struts 2.3.1有弹簧核心等版本3.0.5
https://stackoverflow.com/questions/32741097
复制相似问题