配置如下:
spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path}
<body>
<img th:src="@{/home-page.png}"/>
</body>
为什么图片无法显示??
配置如下:
spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path}
<body>
<img th:src="@{/home-page.png}"/>
</body>
为什么图片无法显示??
3 回答3.6k 阅读✓ 已解决
3 回答2.6k 阅读✓ 已解决
3 回答1.7k 阅读✓ 已解决
1 回答2.1k 阅读✓ 已解决
2 回答1.2k 阅读✓ 已解决
2 回答1.8k 阅读
1 回答997 阅读✓ 已解决
使用默认配置即可
静态文件 Spring Boot会默认访问static文件夹