SpringBoot访问自定义静态资源配置方案
网站如下图
目标:访问page.html和index.html两个文件
配置方法
找到application.yml文件,增加如下配置
spring:
resources:
static-locations: classpath:/,classpath:pages/
访问地址
http://localhost:8080/ 就可以看到index.html的内容了。
SpringBoot访问自定义静态资源配置方案
网站如下图
目标:访问page.html和index.html两个文件
配置方法
找到application.yml文件,增加如下配置
spring:
resources:
static-locations: classpath:/,classpath:pages/
访问地址
http://localhost:8080/ 就可以看到index.html的内容了。