【问题标题】:Unescaped form input value in Thymeleaf template (something similar to utext)Thymeleaf 模板中未转义的表单输入值(类似于 utext)
【发布时间】:2014-12-07 13:44:07
【问题描述】:

我知道您可以使用 utext 显示未转义的文本,如下所述:http://www.thymeleaf.org/doc/usingthymeleaf.html#unescaped-text

但如果我想显示表单输入的未转义值,使用 data-th-value="${model.value}",则没有等效的 data-th-uvalue。

我想知道在百里香中是否有办法做到这一点?如果没有,最好的解决方法是什么?

【问题讨论】:

    标签: html thymeleaf


    【解决方案1】:

    我也有同样的疑问,这就是我为实现这一目标所做的事情

    <input type="hidden" id="responseObj" th:value="${#strings.unescapeJava(responseObj)}" />
    

    这是我找到的唯一方法。

    我希望这是你问的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-10
      • 1970-01-01
      • 2021-03-05
      • 2017-11-21
      • 1970-01-01
      • 2015-05-05
      • 1970-01-01
      • 2019-10-21
      相关资源
      最近更新 更多