一、未處理html
二、處理後前端
相關代碼:java
(1)jar包 工具
(2)前端代碼htm
<td> ${fns:removeHtml(algorithmNeed.needContent)} </td>
(3)工具類ip
/** * 富文本內容轉換 * @param html * @return */ public static String removeHtml(String html){ String unescape = StringEscapeUtils.unescapeHtml4(html); String text = Jsoup.clean(unescape, Whitelist.simpleText()); return text; }
(4)fns.tld文件配置rem
<function> <description>富文本內容轉換</description> <name>removeHtml</name> <function-class>com.common.utils.StringUtils</function-class> <function-signature>java.lang.String removeHtml(java.lang.String)</function-signature> <example>${fns:removeHtml(html)}</example> </function>