1、在struts.xml配置文件中增加访问静态变量的配置
<constant name="struts.ognl.allowStaticMethodAccess" value="true"></constant>
2、在web.xml配置文件中过滤器,使其能过滤jsp相关文件
3、使用s:property 访问
<s:property value="@类路径@方法名称(参数)" escape="false"/>
<constant name="struts.ognl.allowStaticMethodAccess" value="true"></constant>
2、在web.xml配置文件中过滤器,使其能过滤jsp相关文件
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
3、使用s:property 访问
<s:property value="@类路径@方法名称(参数)" escape="false"/>