知识存储
静态资源路径:
而spring boot静态资源路径如下:(其中classpath为src.resources文件夹下)
"classpath: /META-INF/resources/",
"classpath: /resources/",
"classpath: /static/",
"classpath: /public/"
"/":当前项目的根路径
![](https://www.cztcode.com/wp-content/uploads/2020/04/image-11.png)
欢迎页映射规则:
以“/**”的方式映射,系统会默认访问静态资源下的index.html文件
例如:
![](https://www.cztcode.com/wp-content/uploads/2020/04/image-7-1024x322.png)
localhost:8080/(当静态文件夹中有index.html文件时,才可以映射到)
![](https://www.cztcode.com/wp-content/uploads/2020/04/image-8.png)
动态资源
之前讲的thymeleaf便是模板引擎,用来动态渲染
只要我们把HTML页面放在classpath:/templates/,thymeleaf就能自动渲染;