/** * HTML标签转义方法 —— java代码库 * @param content * @return */ public static String html(String content) { if(content==null) return ""; String html = content; html = StringUtils.replace(html, "'", "'"); html = StringUtils.replace(html, "\"", """); html = StringUtils.replace(html, "\t", " ");// 替换跳格 //html = StringUtils.replace(html, " ", " ");// 替换空格 html = StringUtils.replace(html, "<", "<"); html = StringUtils.replace(html, ">", ">"); return html; }