Struts中 There is no Action mapped for namespace [/] and action name []
2016-10-18 09:29
513 查看
在使用了新版Struts2.5时,之前配置的action出了错,爆出如下异常
HTTP Status 404 - There is no Action mapped for namespace [/person] and action name [personAction_getPersonByID] associated with context path [/ssh].
type Status report
message There is no Action mapped for namespace [/person] and action name [personAction_getPersonByID] associated with context path [/ssh].
description The requested resource is not available.我之前配置是这样的
<struts>
<package name="person" namespace="/person" extends="struts-default">
<action name="personAction_*" method="{1}" class="com.zjt.action.PersonAction">
<result name="index">/index.jsp</result>
</action>
</package>
</struts>
经过查找资料,发现,自从Struts2.3之后,通过*和method{}访问的方法默认是不被允许访问的,需要将允许访问的方法进行显示声明,将我的配置文件修改为如下即可
<struts>
<package name="person" namespace="/person" extends="struts-default">
<action name="personAction_*" method="{1}" class="com.zjt.action.PersonAction">
<result name="index">/index.jsp</result>
<allowed-methods>getPersonByID</allowed-methods>
</action>
</package>
</struts>
HTTP Status 404 - There is no Action mapped for namespace [/person] and action name [personAction_getPersonByID] associated with context path [/ssh].
type Status report
message There is no Action mapped for namespace [/person] and action name [personAction_getPersonByID] associated with context path [/ssh].
description The requested resource is not available.我之前配置是这样的
<struts>
<package name="person" namespace="/person" extends="struts-default">
<action name="personAction_*" method="{1}" class="com.zjt.action.PersonAction">
<result name="index">/index.jsp</result>
</action>
</package>
</struts>
经过查找资料,发现,自从Struts2.3之后,通过*和method{}访问的方法默认是不被允许访问的,需要将允许访问的方法进行显示声明,将我的配置文件修改为如下即可
<struts>
<package name="person" namespace="/person" extends="struts-default">
<action name="personAction_*" method="{1}" class="com.zjt.action.PersonAction">
<result name="index">/index.jsp</result>
<allowed-methods>getPersonByID</allowed-methods>
</action>
</package>
</struts>
相关文章推荐
- struts.xml不在默认位置,导致出现HTTP Status 404 - There is no Action mapped for namespace [/] and action name [
- struts 配置出现错误 There is no Action mapped for namespace [/] and action name [findPage] associated with
- 【bug日常】struts报错: There is no Action mapped for namespace [/] and action name [login] associated ...
- eclipse中配置struts2出现eclipse中配置struts2出现There is no Action mapped for namespace [/] and action name [L
- struts2种出现的There is no Action mapped for namespace [/] and action name 错误
- There is no Action mapped for namespace [/] and action name [] associated with context path [/struts
- 部署Struts遇到“There is no Action mapped for namespace [/] and action name [...] associated with .."问题
- Struts 2.5.2 HTTP Status 404 - There is no Action mapped for namespace [/] and action name [regist_A
- maven jetty struts异常 There is no Action mapped for namespace [/] and action name [] associated with context path
- 使用Struts2时出现There is no Action mapped for namespace [/] and action name [??] associated with conte
- 一个struts傻瓜式的问题There is no Action mapped for namespace [/] and action name [] associated with context
- There is no Action mapped for namespace [/pages/action/student] and action name [findStudent]
- 纯注解方式"There is no Action mapped for namespace [/] and action name [Test] associated with conte"原因
- There is no Action mapped for namespace [] and action name [] associated with context path []
- There is no Action mapped for namespace [/] and action name [login] associate解决办法
- There is no Action mapped for namespace [/] and action name [viewLogAction] associated with context
- There is no Action mapped for namespace [/] and action name [Login] associated with context path [/e
- 每当使用struts2动态方法调用时,总是出现错误:There is no Action mapped for namespace [/user] and action name [user!add]
- Struts应用出现的错误及解决方法:There is no Action mapped for namespace / and action name login
- 在使用了Maven后出现了There is no Action mapped for namespace [/] and action name [*] associated with context