就是formbeanSetXXX("<font color=ffffff>xxxx</font>")
在页面中用logic:iterater便利出来就没有效果,页面里的代码把< 变成了 & l t ; 和 & g t ;

解决方案 »

  1.   

    你用什么标签输出的啊:
    应该有个属性设置的:filter="false" 或者escape="false"
      

  2.   

    转换

    public static String toTextForHtml(String txt) {
    if (null == txt) {
    return "";
    }
    txt = txt.replaceAll("&", "&amp;");
    txt = txt.replaceAll("<", "&lt;");
    txt = txt.replaceAll(">", "&gt;");
    txt = txt.replaceAll("\"", "&quot;");
    txt = txt.replaceAll("'", "&#146;");
    return txt;
    }
      

  3.   

    <c:out value="${item}" />
      

  4.   

    如果需要解析 HTML 的话,可以这样<c:out value="${item}" escapeXml="false" />
      

  5.   

    HTML不是有一个这种功能的标签么?