您的位置:首页 > 其它

Unable to instantiate Action, xxxAction, defined for 'xxx' in namespace '/'xxxAction解决方式

2017-07-02 13:45 597 查看
出现这个问题的解决办法主要有两个

1、假设项目没有使用Spring,则struts.xml配置文件里,这个action的class属性的路径没有写完整,应该是包名.类名

2、假设项目使用了Spring。那就是applicationContext.xml里面没有为这个action定义bean。这样strus.xml中的相应action的class属性的值就是Spring配置文件里bean的id。比方:

applicationContext.xml

<bean id="adminAction" class="go.derek.action.AdminAction"
scope="prototype">
</bean>


struts.xml

<action name="admin" class="adminAction" method="execute">
<result>/admin.jsp</result>
</action>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐