---
title: "struts2 ognl 正则去html标签字符串截取"
author: "cy913417"
date: "2012-09-12T09:54:05Z"
tags: []
categories: ["Web前端"]
slug: "struts2-ognl-html"
draft: false
lastmod: "2012-09-12T09:54:05Z"
id: 1676615
url: "https://it456.iteye.com/blog/1676615"
---

```
 <s:property value="#con.body.replaceAll('<[^>]*>','').replaceAll(#con_title,'').substring(0,100)+'...'" escape="false"/>
```

      去html标签并去掉第一个与#con\_title重复的内容，然后截取前100