There is no Action mapped for namespace [/] and action name [Login] associated

使用struts2时出现了:

There is no Action mapped for namespace [/] and action name [Login] associated 

两个可能的错误:

1.struts.xml大小等写错,或者不是放在src目录下。

解决方法:项目右键 -》properties -》Java Build Path -》source -》,要放在webRoot/WEB-INF目录下

 

 2.可能是使用了通配符来配置。

struts2.5后,使用通配符的方式实现动态方法调用要在
<action name="action_*" class="personList" method="{1}">
<allowed-methods>add,addUI,list</allowed-methods>
</action> 
action加入<allow-methods>方法名(可多个)</allowmethods>
这个配置项.

posted @ 2017-12-24 15:17  微尘chq  阅读(875)  评论(0编辑  收藏  举报