struts2通配符高版本不能用解决方法
2018-08-22 本文已影响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" />
使用方法:
