【问题标题】:Thymeleaf - How to pass HTML to the div?Thymeleaf - 如何将 HTML 传递给 div?
【发布时间】:2015-02-04 15:54:40
【问题描述】:

如何将 HTML 从变量传递到 div

我有代码

<div class="content" th:text="${ourService.getShortText()}" />

但它在 div 中不显示 HTML,而是将 HTML 转义为 div 文本。 如何将变量的值不作为转义文本传递,而是作为 div 的内部 HTML 传递?

【问题讨论】:

    标签: html spring thymeleaf


    【解决方案1】:

    解决方法如下:

    <div class="content" th:utext="${ourService.getShortText()}" />
    

    【讨论】:

      猜你喜欢
      • 2020-05-13
      • 1970-01-01
      • 2016-03-26
      • 2017-11-16
      • 1970-01-01
      • 2017-05-20
      • 2018-09-14
      • 2019-09-03
      • 2023-03-18
      相关资源
      最近更新 更多