SpringBoot默认支持访问根路径(localhost:8080/)跳转到欢迎页!
注意index.htm放置位置:/static (or /public or /resources or /META-INF/resources
访问地址:localhost:8080/
但需要注意
- 可以配置静态资源路径
- 但是不可以配置静态资源的访问前缀。否则导致 index.html不能被默认访问
当配置了静态资源路径
spring:
web:
resources:
static-locations: [classpath:/song/]
则需要把index.xml放入song文件夹下或/META-INF/resources路径下。
当配置了静态资源的访问前缀,访问localhost:8080/不会进入欢迎页。