java后台将前台传递的特殊字符转意下传递到前台

来源:互联网 发布:js获取json的key 编辑:程序博客网 时间:2024/05/18 00:54
public static String dencodeHTML(String t) {if (t != null) {t = t.replaceAll("&", "&");t = t.replaceAll("@amp;", "&");t = t.replaceAll(""", "\"");t = t.replaceAll("@quot;", "\"");t = t.replaceAll("<", "<");t = t.replaceAll("@lt;", "<");t = t.replaceAll(">", ">");t = t.replaceAll("@gt;", ">");t = t.replaceAll("’", "'");t = t.replaceAll("@#146;", "'");t = t.replaceAll(" ", " ");t = t.replaceAll("@nbsp;", " ");t = t.replaceAll("", "\r");t = t.replaceAll("", "\n");t = t.replaceAll("", " ");t = t.replaceAll("%23", "#");t = t.replaceAll("\n\r", "\n");t = t.replaceAll("\r\n", "\n");}return t;}

0 0