java struts2静态方法调用问题
在struts2中,我知道我们可以通过OGNL调用静态方法。从下午开始,我一直试图调用这个静态方法,但似乎无法找出问题所在
struts。xml配置:
<constant name="struts.ognl.allowStaticMethodAccess" value="true" />
jsp页面:
.....<s:property value='@com.aesthete.csmart.web.server.fw.common.config.Properties@getDefaultProperty("maxdemocountwords")'/>....
财产。爪哇
public static String getDefaultProperty(String key){
return defaultProps.getProperty(key);
}
我有什么遗漏吗
# 1 楼答案
您是否检查了
struts.properties
中的struts.ognl.allowStaticMethodAccess
属性是否设置为true