struts2 升級到2.3.8後 使用property標籤 html字符轉義

  昨天升級了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="" />

就 能正常顯示了


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章