Struts2中页面上访问后台static类中的方法

1、在struts.xml中保证(或者设置)
<constant name="struts.ognl.allowStaticMethodAccess" value="true" />

2、页面上:
<s:property value="@com.utils.SubStringUtil@splitString'fdasfdsafsafasfsafsafsafsad',6,'...')"/>
<s:property value="@java.lang.Math@floor(44.56) "/>

你可能感兴趣的:(java,xml,struts)