您的位置:首页 > 编程语言 > Java开发

struts2 升级到2.3.8后 使用property标签 html字符转义

2013-07-26 11:24 302 查看
昨天升级了struts2 的jar。 今天就看见后台

共有[<font color='#FF0000'>299</font>]条记录,1/60页。 <a href='JavaScript:tuneNewProductPage(1,5)'><font color='#FF0000'><b>1</b></font></a> <a href='JavaScript:tuneNewProductPage(2,5)'>2</a> <a
href='JavaScript:tuneNewProductPage(3,5)'>3</a> <a href='JavaScript:tuneNewProductPage(4,5)'>4</a> <a href='JavaScript:tuneNewProductPage(5,5)'>5</a> <a href='JavaScript:tuneNewProductPage(6,5)'>...</a> <a href='JavaScript:tuneNewProductPage(2,5)'><font face='Webdings'>8</font></a>
<a href='JavaScript:tuneNewProductPage(60,5)'><font face='Webdings'>:</font></a>

页面数据全是Html代码,还有很多奇怪的报错,追查之下 才发现 全是struts2.3.8 的原因,以前的版本使用
<s:property value="" />


标签没有对 含有html标签的字符进行转义,升级之后就转义了,导致页面数据显示不正确,

加上
<s:property escape="false" value="" />


就 能正常显示了

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: