struts 使用通配符方式访问action时,出现HTTP Status 404 - There is no Action mapped for namespace [/] and action name [hello_add] associated with context path [/StrutsDemo].

 那些年踩过的struts坑之今生无悔系列.......

还是原来的配方,还是熟悉的味道,

struts.xml配置

 

HelloAction类为:

 

 

看了很多大大的文章

原来是struts2.5 为了提升安全性,添加了
allowed-method这个标签

刚开始,我是在里面用了具体的方法做测试,

证明可行,然后搜集一种扩展性更好的写法,其中踩过的坑:regex:*      

正确的是regex:.*            

这一点可不能少啊,会报错报的你怀疑人生的啊,兄弟

 

OK,成功了

 ,

posted on 2018-04-27 00:46  HuTaoYing  阅读(264)  评论(0编辑  收藏  举报