spring:
mvc:
static-path-pattern: /res/**
web:
resources:
static-locations: [classpath:/haha/]
请注意:指定新的静态资源文件夹的位置之后,springboot默认的就不生效了,也就是说我们要通过我们指定的文件夹的位置去访问静态资源,以前的不能访问
========================================================================
静态资源路径下 index.html
-
可以配置静态资源路径
-
但是不可以配置静态资源的访问前缀。否则导致 index.html不能被默认访问
spring:
mvc:
static-path-pattern: /res/** 这个会导致welcome page功能失效
resources:
static-locations: [classpath:/haha/]
- controller能处理/index
favicon.ico 放在静态资源目录下即可,名字必须叫favicon
spring: