Struts2标签中访问静态变量或者方法

来源:互联网 发布:美工常用设计字体打包 编辑:程序博客网 时间:2024/05/21 21:51

Struts2标签中访问静态变量或者方法

在2.1.2中,如果要通过ognl访问静态方法,必须在struts.properties或者struts.xml中将选项struts.ognl.allowStaticMethodAccess设置为true .

<s:proptery value="@com.work.core.QxglConstants@TOP_LEVEL_TOP"/>

<s:if test="#session.deptid==@com.work.core.QxglConstants@TOP_LEVEL_DEPT_ID">复检受理</s:if>

注意:访问的类名必须是全称 。是@com.work.core.QxglConstants而不是@QxglConstants

原创粉丝点击