Struts2 关于2.5的通配符问题

报错:There is no Action mapped for namespace [/] and action name [emp-edit] associated with context path [/struts2-5]


 

解决办法:向 struts.xml 中的package 添加一个属性 如下

<package name="default" namespace="/" extends="struts-default"  strict-method-invocation="false">

 

理由:struts2从2.5版本开始,为了提升安全性,默认开启了严格的方法调用。如果要使用通配符*,必须在package中设置 strict-method-invocation=“false”


参考来源: https://blog.csdn.net/Holmofy/article/details/78387958

 

posted @ 2020-07-20 21:14  墨白95  阅读(349)  评论(0编辑  收藏  举报