Struts2中使用struts2标签访问静态方法

  1. 在struts.xml配置文件中添加:jsp

    <constant name="struts.ognl.allowStaticMethodAccess" value="true"/>xml

    2.在jsp页面使用struts2标签:get

xx表示包名,struts2

xxx类名,配置

getxxx静态方法名。方法

    <s:property value="@xx.xx.xx.xxx@getxxx()"/>配置文件

相关文章
相关标签/搜索