Reputation: 13
I want to display an image in the browser from a click of a button.
In my view, I loop over a list that returns to me my controller. For each element of the list I would like to be able to display the image associated with the element. The images are in a folder placed at the root it is in the resources folder.
Upvotes: 1
Views: 403
Reputation: 89314
Use the <img>
tag inside th:each
.
<img th:src="@{'/photos/' + ${vehicules.image}}"/>
Upvotes: 1