Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 453
ryo kato Avatar asked Dec 11 '22 03:12

ryo kato


1 Answers

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

like image 137
Aeseir Avatar answered Jan 28 '23 13:01

Aeseir