添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
在resources/static下存放图片,或者在resources/static下新建目录存放图片。访问图片的路径为新建的目录名/图片名
启动主程序,就可以直接访问了 这是我的URL:http://localhost:8081/imgs/lyf.png

Spring Boot整合Thymeleaf
本文介绍如何在Spring Boot项目中添加Thymeleaf依赖,并在resources/static目录下存放图片资源,通过指定URL路径直接访问这些静态资源。
777

被折叠的 条评论
为什么被折叠?



