Skip to content Skip to sidebar Skip to footer

How Can I Loop Over An ArrayList Using Thymeleaf & Spring Boot?

I am new to thymeleaf and i try to loop over a ArrayList but it doesn't work for me .. some help please: this is my Html page: this is My controller

Solution 1:

You have a typo in your iteration (see the docs, they are very good):

  <tr th:each="data: ${mois}">

Don't forget you can get the iteration index, useful to generate the id of elements

  <tr th:each="data, iterstat: ${mois}">
     <td th:text="${data}" th:id="|td${iterstat.index}|"></td>
  </tr>

Post a Comment for "How Can I Loop Over An ArrayList Using Thymeleaf & Spring Boot?"