Unable to instantiate Action, xxxAction, defined for ‘xxx’ in namespace ‘/’xxxAction解决方案

2014年09月05日 ⁄ 综合 ⁄ 共 401字 ⁄ 字号 ⁄ 评论关闭

出现这个问题的原因主要有两个

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

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

applicationContext.xml

<bean 
	scope="prototype">
	</bean>

struts.xml

<action name="admin" class="adminAction" method="execute">
			<result>/admin.jsp</result>
		</action>
3.补充也可能是@Controller("UnitAction") Unit大小写问题

相关文章:

  • 2022-12-23
  • 2022-01-21
  • 2021-12-01
  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2021-08-28
  • 2021-12-13
  • 2021-11-18
  • 2022-12-23
相关资源
相似解决方案