Thymeleaf 如何避免“双引号”;在百里香?
我想在Thymeleaf中的字符串中加双引号,我有如下形式:Thymeleaf 如何避免“双引号”;在百里香?,thymeleaf,Thymeleaf,我想在Thymeleaf中的字符串中加双引号,我有如下形式: <td th:text='${"Value of \"" + item + "\" is \"" + value + "\"."}'></td> 我怎样才能做到这一点呢?我不确定这是否可能。类似这样的工作原理: th:text='|Value of "${item}" is "${value}".|' 我个人会这样写: th:text="${'Value of "' + item + '&
<td th:text='${"Value of \"" + item + "\" is \"" + value + "\"."}'></td>
我怎样才能做到这一点呢?我不确定这是否可能。类似这样的工作原理:
th:text='|Value of "${item}" is "${value}".|'
我个人会这样写:
th:text="${'Value of "' + item + '" is "' + value + '".'}"
我认为没有办法避开双引号的原因是,thymeleaf首先解析为xml/html(除了“
”之外没有其他转义),然后解析为thymeleaf second,它实际上没有机会得到这些字符串
th:text='|Value of "${item}" is "${value}".|'
th:text="${'Value of "' + item + '" is "' + value + '".'}"