SpringBoot项目静态资源文件的加载顺序
静态资源文件的加载顺序
优先级排列:
- spring boot项目只有src目录,没有webapp目录,会将静态访问(html/图片等)映射到其自动配置的静态目录,如下
- /static
- /public
- /resources
- /META-INF/resources
比如,在resources建立一个static目录和index.htm静态文件,访问地址 http://localhost:8080/index.html
优先级排列:
比如,在resources建立一个static目录和index.htm静态文件,访问地址 http://localhost:8080/index.html