如何在Java中禁用HTML编码

如何在Java中禁用HTML编码,java,html,encoding,Java,Html,Encoding,此注释具有HTML标记。因此,当我们将此评论作为邮件发送时,我们会在邮件中看到这样的编码HTML: task.addText(comment); 但没有起作用 这来自评论数据库: comment=StringEscapeUtils.unescapeHtml(comment); 或 我们在将其转换为html时也有此功能 HtmlEscapers.htmlEscaper().escape(comment) 而百里哀拉夫没有起作用。转换到我想我找到了: context.setVariab

此注释具有HTML标记。因此,当我们将此评论作为邮件发送时,我们会在邮件中看到这样的编码HTML:

    task.addText(comment);
但没有起作用

这来自评论数据库:

comment=StringEscapeUtils.unescapeHtml(comment);

我们在将其转换为html时也有此功能

HtmlEscapers.htmlEscaper().escape(comment)
而百里哀拉夫没有起作用。转换到
我想我找到了:

context.setVariables(mail.getParams());
消息。。。

添加了删除标记和utext

您应该将注释设置为HTML页面上节点的innerHTML,而不是将其添加为文本输入值。
comment=StringEscapeUtils.unescapeHtml(comment);
<h3>asdasas as<b>asdasdas</b>dasdas<u>dasdasdasd<strike>asdasdasdsadasdasdas<span id="selectionBoundary_1493731518682_030677381665187298" class="rangySelectionBoundary"></span></strike></u></h3>
escapeHtml but did not work.
HtmlEscapers.htmlEscaper().escape(comment)
Context context = new Context(Locale.forLanguageTag("tr-TR"));
context.setVariables(comment);
context.setVariables(mail.getParams());

String process = templateEngine.process(mail, context);
Context context = new Context(Locale.forLanguageTag("tr-TR"));
context.setVariables(mail.getParams());
<td th:utext="${Comment}" th:remove="tag" >message ...</td>