springboot 配置静态资源访问
springboot 配置静态资源访问
在 application.properties 里面 配置
spring.resources.static-locations=\ classpath:/META-INF/resources/, classpath:/resources/,classpath:/static/, classpath:/public/,classpath:/templates/
你要访问的 资源在那个文件夹中 就配置 那个文件夹
点击 spring.resources.static-locations 可以看见它默认可以访问的资源
也可以去试试
<!--静态资源--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>