美文网首页
struts2通配符高版本不能用解决方法

struts2通配符高版本不能用解决方法

作者: 凯凯_ | 来源:发表于2018-08-22 09:05 被阅读81次

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

    1、struts2.5 为了增加安全性,在 struts.xml 添加了这么个属性:

    <global-allowed-methods>regex:.*</global-allowed-methods>

    使用方法:

    2、当使用动态调用方法时(action名 + 感叹号 + 方法名进行方法调用),则需要在配置文件中加上配置:

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

    使用方法:

    相关文章

      网友评论

          本文标题:struts2通配符高版本不能用解决方法

          本文链接:https://www.haomeiwen.com/subject/nckeiftx.html