在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" />
使用方法:

网友评论