if(content==nullreturn "";       
    String html = content;
    html = StringUtils.replace(html, "'""'");
    html = StringUtils.replace(html, "\""""");
    html = StringUtils.replace(html, "\t""  ");// 替换跳格
    //html = StringUtils.replace(html, " ", " ");// 替换空格
    html = StringUtils.replace(html, "<""&lt;");
    html = StringUtils.replace(html, ">""&gt;");
    return html;

 

HTML标签转义方法 - java代码库 - 云代码 http://yuncode.net/code/c_50d01e073973762