报错:com.alibaba.fastjson.JSONException: illegal identifier : &pos 1, line 1, column


报错:com.alibaba.fastjson.JSONException: illegal identifier : &pos 1, line 1, column

原因:将HtmlUtils.htmlUnescape()错些成HtmlUtils.htmlEscape()

两种方法的不同:
String s=HtmlUtils.htmlEscape("

hello world

 

");

输出<div>hello world</div><p>&nbsp;</p>

String s2=HtmlUtils.htmlUnescape(s);

输出

hello world

 

如果希望文本出现html标签的内容,如<>,这些符号,就是使用htmlUnescape(s)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM