struts2标签<s:property 输出带有html标签的字符串的解决方案
2014-09-12 08:15
447 查看
转自:http://blog.csdn.net/allenlinrui/article/details/6290486
有时候用<s:property 输出一些带有html字符的控制字符串,本意是想让它可以解析成一些功能文字,比如超链接。可是,struts2会把HTML原样输出,因为struts标签会对html进行自动的编码。
解决办法:
此标签有内置属性escape,默认值是true。把escape设置为"false"就行了……
example:
<s:property value="存有HTML的变量或表达式" escape="false"/>
有时候用<s:property 输出一些带有html字符的控制字符串,本意是想让它可以解析成一些功能文字,比如超链接。可是,struts2会把HTML原样输出,因为struts标签会对html进行自动的编码。
解决办法:
此标签有内置属性escape,默认值是true。把escape设置为"false"就行了……
example:
<s:property value="存有HTML的变量或表达式" escape="false"/>
相关文章推荐
- struts2 <s:property/>标签的使用--输出时间格式转换
- 读取数据库带有html的字符串在前台显示,html标签与属性之间空格消失了,如<pclass=''>
- struts2 <s:property/>标签的使用--输出时间格式转换
- struts2 <s:property/>标签的使用--输出时间格式转换
- struts2标签:<s:if><s:else>实现选择输出
- struts2 标签之<s:property />
- Struts2标签库(3):利用<s:property.../>标签访问Struts2的命名对象
- struts2 标签 property中对HTML标签输出
- (有效)struts2 标签 property中对HTML标签输出
- struts2 标签 property中对HTML标签输出
- struts2 标签向 javascript输出带有双引号的字符串的问题
- struts2标签<s:property value=""/> ognl和el .
- Struts2 <s:property /> 标签用法
- @Html.Raw() 方法输出带有html标签的字符串
- struts2利用<s:fielderror/>等标签详细地控制错误消息输出格式
- struts2 <s:property/>标签的使用--输出时间格式转换
- Struts2的标签显示日期、<s:debug>标签、<s:property>使用技巧
- struts2 <s:submit>国际化时提示警告关于ognl.OgnlException: target is null for setProperty(null的解决方案
- HTML <area> 标签实现带有可点击区域的图像映射
- struts2标签<s:property value=""/> ognl和el