springboot 配置静态资源访问

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Mr_yangzc/article/details/80805035

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>




猜你喜欢

转载自blog.csdn.net/Mr_yangzc/article/details/80805035
今日推荐