StringEscapeUtils对字符串进行各种转义与反转义

项目过程中导出的word无法打开,发现是由于里面有&字符造成,需要进行HTML字符的转义:

 StringEscapeUtils.escapeHtml4(“需要转义的字符”);

已解决。

参考:http://blog.csdn.net/chenleixing/article/details/43456987

原文地址:https://www.cnblogs.com/sucia-panda/p/6626453.html