Java Thymeleaf中的条件句

Java Thymeleaf中的条件句,java,html,spring,spring-boot,thymeleaf,Java,Html,Spring,Spring Boot,Thymeleaf,我的Thymeleaf模板中有这段代码 <INPUT TYPE="text" TH:VALUE="${searchForm.male}" /> <span th:if="${searchForm.male == 'true' }"> IS TRUE </span> <span th:unless="${searchForm.male == 'true'}">

我的Thymeleaf模板中有这段代码

<INPUT TYPE="text" TH:VALUE="${searchForm.male}" />
<span th:if="${searchForm.male == 'true' }">
   IS TRUE
</span>
<span th:unless="${searchForm.male == 'true'}">
   IS NOT TRUE
</span>

是真的
事实并非如此
但我看到的是:


如果male属性是布尔属性,只需删除引号,如下所示

<input type="text" th:value="${searchForm.male}"/>
<span th:if="${searchForm.male == true }">IS TRUE</span>
<span th:unless="${searchForm.male == true}">IS NOT TRUE</span>


是真的
事实并非如此

如果male属性是布尔属性,只需删除引号,如下所示

<input type="text" th:value="${searchForm.male}"/>
<span th:if="${searchForm.male == true }">IS TRUE</span>
<span th:unless="${searchForm.male == true}">IS NOT TRUE</span>


是真的
事实并非如此