Java问题集锦--The type StringEscapeUtils is deprecated

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/pengjunlee/article/details/89043968

“The type StringEscapeUtils is deprecated”

之前一直使用commons-lang3-3.x.jar 这个jar包里面的 org.apache.commons.lang3.StringEscapeUtils 类来转义特殊字符,但是最近发现使用这个类会出现以下提示: 

Multiple markers at this line
	- The type StringEscapeUtils is deprecated
	- The method escapeXml11(String) from the type StringEscapeUtils is deprecated

  解决方法,StringEscapeUtils 这个类已经过期了,需要引入它的替代类 org.apache.commons.text.StringEscapeUtils 的Maven依赖,如下所示:

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-text</artifactId>
    <version>1.1</version>
</dependency>

猜你喜欢

转载自blog.csdn.net/pengjunlee/article/details/89043968
今日推荐