您的位置:首页 > 编程语言 > Java开发

struts2.5使用通配符时action指定method报错不使用通配符则正常

2017-12-16 22:21 453 查看
HTTP Status 404 - There is no Action mapped for namespace
[/test] and action name [SecondAction_hello] associated with
context path [/Struct2msb]




配置文件

<action name="*_*" class="com.csy.struct2.{1}" method="{2}">
<result name="success">/{1}_{2}_success.jsp</result>
<result name="fail">/{1}_{2}_fail.jsp</result>
</action>


**诡异的是

method=”{2}”不使用通配符则正常**

解决办法

在struts2.3之前的版本,正常的配置就可以了,但在struts2.3版本之后,使用通配符调用方法时,内部会验证是否允许访问该方法,所以要加上

方法名1,方法名2…



后续文章持续更新中,微信扫码下方二维码免费关注!点此查看全部最新文章



我的博客

我的简书

我的GitHub,喜欢的话给个star吧
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  struts struts2.0 javaweb