就是formbeanSetXXX("<font color=ffffff>xxxx</font>")
在页面中用logic:iterater便利出来就没有效果,页面里的代码把< 变成了 & l t ; 和 & g t ;
------解决方案--------------------
你用什么标签输出的啊:
应该有个属性设置的:filter="false" 或者escape="false"
------解决方案--------------------
转换
- Java code
public static String toTextForHtml(String txt) { if (null == txt) { return ""; } txt = txt.replaceAll("&", "&"); txt = txt.replaceAll("<", "<"); txt = txt.replaceAll(">", ">"); txt = txt.replaceAll("\"", """); txt = txt.replaceAll("'", "’"); return txt; }
------解决方案--------------------
如果需要解析 HTML 的话,可以这样
<c:out value="${item}" escapeXml="false" />