SpringBoot 对静态资源的映射规则:
-
对 localhost:8080/webjars/* ,映射到
classpath:/META-INF/resources/webjars/
以 jar 包的方式引入静态资源
-
对 localhost/** ,映射到
classpath:/META-INF/resuorces/
classpath:/resuorces/
classpath:/static/
classpath:/public/
/ (当前项目的根路径)
-
欢迎页 localhost:8080/:静态资源文件下的所有 index.html 页面
-
页面图标 **/favicon.ico 在静态资源文件夹找
Thymeleaf
-
Maven 引入 jar 包
-
解析前缀 classpath:/templates/
解析后缀 .html