maven+ssh struts2+spring编译不成功的问题

Action配置到spring中,一直报action找不到的错误,struts2.xml中加入<constant name="struts.objectFactory" value="spring"></constant>,又会报其他各种错误:Cannot locate the chosen ObjectFactory implementation: spring 。

网上解决的办法是:1、缺少  struts2-spring-plugin  2、Action名字不一致。

但百思不得其解,用maven导包,没有少什么。直到百度java struts2中的action如何交由spring管理,发现知道里有人回答

注意看struts2-spring-plugin里面的struts-plugin.xml,可以判断是否需要添加

<constant name="struts.objectFactory" value="spring"> 就可识别。。。查看maven的struts2-spring-plugin包里,并无此文件,

就猜到可能是本地仓库的jar包问题,替换成正常的jar包,果然有用。

猜你喜欢

转载自blog.csdn.net/xclsgfr/article/details/86300411
今日推荐