首页 > 移动平台 > 详细

HTTP Status 404 - There is no Action mapped for namespace [/] and action name [Action!Method]错误解决

时间:2015-01-14 21:06:26      阅读:453      评论:0      收藏:0      [点我收藏+]

按照书本上的Struts2的例子,运行会出现错误:

HTTP Status 404 - There is no Action mapped for namespace [/] and action name [sayHelloAction!sayStruts2] ...

 貌似在struts.xml中配置action的method不会出错,而直接在jsp中写“Action!Method.action”就会报错。

搜索许久没有发现解决办法,后来发现第二种写法叫做“DMI”,会产生安全隐患,在struts2的某个版本后就默认关闭了(我使用的是Struts 2-2.3.20)。于是在struts.xml的<struts></struts>中添加下面一行即可:

<constant name="struts.enable.DynamicMethodInvocation" value="true" />

 

HTTP Status 404 - There is no Action mapped for namespace [/] and action name [Action!Method]错误解决

原文:http://www.cnblogs.com/afeng7882999/p/4224757.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!