求高手来解决!谢谢了!Unable to instantiate Action, defined for in namespace '/'

HTTP Status 500 - Unable to instantiate Action,TestAction, defined for 'productTest' in namespace '/'Error creating bean with name 'TestAction': Resolution of declared constructors on bean Class [TestAction] from ClassLoader [WebappClassLoader

我刚好也遇到这样的情况,发现是自己的配置文件里写错了,spring里的id属性值要对应struts里class属性值。

温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-04-18
如果在spring的配置文件和struts.xml的配置文件都是正常的话,可以去web.xml配置文件中,添加对spring的支持哪里看看,
<!-- 添加对spring的支持 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/applicationContext.xml,
/WEB-INF/spring/applicationContext-sys.xml,
/WEB-INF/spring/applicationContext-dsc.xml
/WEB-INF/spring/applicationContext-proj.xml
</param-value>
</context-param>
我的就是这里忘记添加第三个,所以一直报错,填上去就好了
第2个回答  2013-07-23
这是你struts.xml文件配置有错,把namespace取个名字,请求时路径为:localhost:8080/项目名/namespace名/action名字