解决SpringBoot项目无法访问resources/static下静态资源,报404 1. 报错 在html文件中引入了static下的资源,如下: <link rel="stylesheet" th:href="@{/static/styles.css}" /> <img th:src="@{/static/images/TacoCloud.png}"/> 报错: 2. 解决办法 在配置文件application.properties中添加配置: spring.mvc.static-path-pattern=static/** 测试成功: