Reputation: 2153
I have this piece of code in my Thymeleaf template
<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>
but this is what I see :
Upvotes: 0
Views: 430
Reputation: 364
If the male property is boolean just remove the quotes as follows
<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>
Upvotes: 2