//添加依赖
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
//测试
public static void main(String[] args) {
//针对特殊符号进行转义与反转义 例:<>
System.out.println("转义:"+StringEscapeUtils.escapeXml("<>"));
//输出转义:<>
System.out.println("反转义:"+StringEscapeUtils.unescapeXml("<>"));
//输出反转义:<>
}