问题描述
我找不到任何解释为什么Apache Lang3 v3.7中不推荐使用StringEscapeUtils.
I couldn't find any explanation why StringEscapeUtils was deprecated from Apache Lang3 v3.7.
我们现在应该使用什么来进行HTML转义/转义
What are we supposed to use now for HTML escaping/unescaping
推荐答案
该类已从软件包中移出
到
您可以轻松替换不推荐使用的库:
在您的build.gradle中:
In your build.gradle:
implementation 'org.apache.commons:commons-text:1.8'
在使用StringEscapeUtils
的班级中,请确保您导入了正确的班级:
And in your class using StringEscapeUtils
make sure you import the correct class:
import org.apache.commons.text.StringEscapeUtils;
1.8是当前最新版本(最后检查于2019年10月22日),但您可以在maven中检查版本: https://mvnrepository.com/artifact/org.apache.commons/commons-text
1.8 is currently the newest version (last checked October 22nd 2019) but you can check the versions at maven:https://mvnrepository.com/artifact/org.apache.commons/commons-text
这篇关于为什么不赞成使用org.apache.common.lang3 StringEscapeUtils?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!