---
title: "struts2 解决property 含有html 原样输出的问题"
author: "xiaofeiyan"
date: "2014-05-06T16:04:27Z"
tags: []
categories: ["Web前端"]
slug: "struts2-property-html"
draft: false
lastmod: "2014-05-06T16:04:27Z"
id: 2062189
url: "https://xiaofeiyan.iteye.com/blog/2062189"
---

有时候用&lt;s:property 输出一些带有html字符的控制字符串，本意是想让它可以解析成一些功能文字，struts2会把HTML原样输出，因为struts标签会对html进行自动的编码。

 

**解决办法：**

**此标签有内置属性escape，默认值是true。把escape设置为"false"就行了……**

**example：**

      

&lt;s:property value="#fun.TASK\_MESSAGE" escape="false"/&gt;