0

I'm very new to spring boot, and I have to do a proyect with Thymeleaf. I can't figure out how to load the variable images from my folders.

<div class="row" th:fragment="searched-film">
    <div class="card m-2" style="width: 12rem;" th:each="film : ${films}">
        <img alt="Póster de la película" class="card-img-top p-3"
             th:src="@{${'./static/images/peliculas/' + film.poster}}">
        <div class="card-body">
            <h5 class="card-title" th:text="${film.title}"></h5> <h6 class="card-title"
                                                                     th:text="'(' + *{film.year} + ')'"></h6>
        </div>
    </div>
</div>

Title and the year works, but images dont load. the files are in 'FilmoTokio\src\main\resources\static\images\peliculas', meanwhile this html in 'FilmoTokio\src\main\resources\templates'

This is the github: FilmoTokio

I tried to change the link, I used th:hrc, I changed the folder's name...

  • Does this answer help? [inserting-an-image-from-local-directory-in-thymeleaf-spring](https://stackoverflow.com/questions/29460618/inserting-an-image-from-local-directory-in-thymeleaf-spring-framework-with-mave) – Dirk Deyne Dec 26 '22 at 10:01

0 Answers0