ryo kato
ryo kato

Reputation: 61

How do I set up multiple conditions on Thymeleaf

I want to set up some conditions on Thymeleaf templates like this, but it doesn't work.

<li th:if="${entry.description != null && entry.owner == true}" th:each="entry : ${entryList}" class="group">

How do I make this code correctly work?

Upvotes: 5

Views: 20568

Answers (1)

Aeseir
Aeseir

Reputation: 8434

Replace

"${entry.description != null && entry.owner == true}"

with

"${entry.description != null and entry.owner == true}"

For reference you can check out this thread: http://forum.thymeleaf.org/How-to-have-multiple-condition-in-an-th-if-tag-td4025931.html

Let me know how you go

Upvotes: 14

Related Questions