<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"/>