StringEscapeUtils类转义与反转义(对js sql html xml等代码进行转义)

public class Test {

         String s = "

111111

";           System.out.println(StringEscapeUtils.escapeHtml3(s));                      String u = "<p><em><strong><span style="background-color:#ff0000;">111111</span></strong></em></p>";           System.out.println(StringEscapeUtils.unescapeHtml3(u));  }

你可能感兴趣的:(java)