<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
当时引入了模板引擎 static中得静态资源说啥都访问不到,后来加入了配置就好了
spring:
mvc:
static-path-pattern: /static/**
resources:
static-locations: classpath:/static
WebMvcAutoConfiguration中
这个是设置得请求方式,put,delete,get啥的
获取我们得资源路径
springboot得静态资源路径配置
ResourceProperties这个类
private static final String[] CLASSPATH_RESOURCE_LOCATIONS = new String[]{"classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"};