【问题标题】:Display images with Thymeleaf - Spring Boot使用 Thymeleaf 显示图像 - Spring Boot
【发布时间】:2021-06-27 12:43:31
【问题描述】:

谁能告诉我我做错了什么?

我无法使用 Thymeleafand Spring Boot 显示图像,这是我的文件夹结构:

这是 html 和 thymeleaf 代码:

 <div class="row">
    <div class="col-md-12">
      <img class="img-responsive" src="../static/images/photo.png" th:src="@{/resources/static/images/photo.png}"/>
    </div>
</div>

【问题讨论】:

    标签: html spring spring-boot thymeleaf


    【解决方案1】:

    尝试更改为

    <img class="img-responsive" src="../static/images/photo.png" th:src="@{images/photo.png}" />
    

    【讨论】:

      猜你喜欢
      • 2019-01-02
      • 2023-01-02
      • 1970-01-01
      • 2021-02-19
      • 1970-01-01
      • 2020-11-28
      • 1970-01-01
      • 2021-06-03
      • 2020-12-17
      相关资源
      最近更新 更多