I succeeded :) Here is the solution:
in the controller:
(...) Person p1 = new Person(); p1.setAge(20); Person p2 = new Person(); p2.setAge(30); List<Person> list = Lists.newArrayList(p1,p2); modelMap.addAttribute("list", list); Integer minAge = 13; modelMap.addAttribute("minAge", minAge); (...)
in html:
<table th:with="min=${minAge}"> <tr th:each="person,rowStat : ${list.?[age > __${min}__]}"> <td><span th:text="${person.age}"></span></td> </tr> </table>
Output:
30
Hope for this help
source share