title: How to Filter a list of objects in Thymeleaf on an object Property
body: <p>I have tried searching on StackExchange and also looked at other places using Google and the Thymeleaf reference as well. It seems like the syntax below should work but it is not filtering the list based on condition given. </p>
  
  <pre><code>&lt;th:block th:each="dayNumber :${#numbers.sequence(1,7)}"&gt;
       &lt;p th:if="${#lists.isEmpty(storeHours.?[#this.dayOfWeek eq #dayNumber])}" th:text="${dayNumber}"&gt;&lt;/p&gt;
  &lt;/th:block&gt;
  </code></pre>
  
  <p>In above, we are trying to do a pretty simple filter. The <code>storeHours</code> is a list of Store Hours object. Each object has a property called <code>dayOfWeek</code>. It is an integer. In above, I am trying to simply print the missing day number. However, it is printing all 7 days. </p>
  
  <p>I am sure I am missing something very basic here. </p>
  
  <p>Any help is appreciated. </p>