---
title: "Struts2中页面上访问后台static类中的方法"
author: "san586"
date: "2009-09-14T19:05:16Z"
tags: []
slug: "struts2-static"
draft: true
lastmod: "2009-09-14T19:05:16Z"
id: 468582
url: "https://ss3ex.iteye.com/blog/468582"
---

1、在struts.xml中保证（或者设置）

```xml
<constant name="struts.ognl.allowStaticMethodAccess" value="true" />
```

2、页面上：

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