在SpringBoot中配置静态资源路径 访问static public templates时,相当于访问http://127.0.0.1:8080/。 login.html中background设置背景文件路径: 这里报错不影响使用。 需要加载Springboot访问静态资源的jar文件:在pom.xml文件中加入 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>