Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Thymeleaf 如何避免“双引号”;在百里香?_Thymeleaf - Fatal编程技术网

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 &quot;' + item + '&

我想在Thymeleaf中的字符串中加双引号,我有如下形式:

<td th:text='${"Value of \"" + item + "\" is \"" + value + "\"."}'></td>

我怎样才能做到这一点呢?

我不确定这是否可能。类似这样的工作原理:

th:text='|Value of "${item}" is "${value}".|'
我个人会这样写:

th:text="${'Value of &quot;' + item + '&quot; is &quot;' + value + '&quot;.'}"
我认为没有办法避开双引号的原因是,thymeleaf首先解析为xml/html(除了
”之外没有其他转义),然后解析为thymeleaf second,它实际上没有机会得到这些字符串

th:text='|Value of "${item}" is "${value}".|'
th:text="${'Value of &quot;' + item + '&quot; is &quot;' + value + '&quot;.'}"