0
在郵件我想顯示一個Java變量:Thymeleaf:顯示一個變量包含HTML標籤
context.setVariable("content", "Hi<br>This is a test<p></p>");
在郵件模板我做的:
<p><span th:text="|${content}|"></span></p>
在郵件這被轉換:
<p><span>Hi<br>this is a test<p></p></span></p>
如何使變量很好地解釋。
謝謝。
[工藝thymeleaf變量作爲HTML代碼,而不是串(的可能的複製http://stackoverflow.com/questions/23156585/process-thymeleaf-variable- AS-HTML的代碼和不串) – DimaSan