Java 带文本模板模式的Thymeleaf中的条件

Java 带文本模板模式的Thymeleaf中的条件,java,if-statement,thymeleaf,Java,If Statement,Thymeleaf,我正在尝试用纯文本处理thymeleaf模板,其中包括条件运算符: <th:block th:if = "${[(${test})] == true}"> it works </th:block> 但我有这样的输出: <th:block th:if = "${true == true}"> it works </th:block> 你能告诉我,我哪里出错了吗?如果你正在使用,你就不能再使用像这样的html标记了。相反,语法如下所示: [

我正在尝试用纯文本处理thymeleaf模板,其中包括条件运算符:

<th:block th:if = "${[(${test})] == true}"> it works </th:block>

但我有这样的输出:

<th:block th:if = "${true == true}"> it works </th:block>

你能告诉我,我哪里出错了吗?

如果你正在使用,你就不能再使用像
这样的html标记了。相反,语法如下所示:

[# th:if="${test}"]it works[/]

哦,是真的。我删除了html标记,现在它开始工作了。非常感谢。