October 2018
Intermediate to advanced
982 pages
23h 29m
English
Now we can make edits to our Thymeleaf template and create input fields for people to write comments:
<td>
<ul>
<li th:each="comment : ${image.comments}"
th:text="${comment.comment}"></li>
</ul>
</td>
<td>
<form th:method="post" th:action="@{'/comments'}">
<input name="comment" value="" type="text" />
<input name="imageId" th:value="${image.id}" type="hidden" />
<input type="submit" />
</form>
</td>
The section of our preceding template where each row is rendered can be explained as follows:
Read now
Unlock full access