Here's my code, where I'm iterating through:
<tr th:each="category : ${categories}">
<td th:text="${category.idCategory}"></td>
<td th:text="${category.name}"></td>
<td>
<a th:href="@{'/category/edit/' + ${category.id}}">view</a>
</td>
</tr>
The URL it points to is supposed to be /category/edit/<id of the category>
, but it says it could not parse the expression:
Exception evaluating SpringEL expression: "category.id" (category-list:21)
The right way according to Thymeleaf documention for adding parameters is:
<a th:href="@{/category/edit/{id}(id=${category.idCategory})}">view</a>