Springboot---Web(五)

SpringBoot对静态资源的映射规则

1)、所有/webjars/,都去classpath:/META-INF/resources/webjars/找资源;**

webjars:以jar包的方式引入静态资源;

2)、"/"访问当前项目的任何资源,都去(静态资源的文件夹)找映射**

	 "classpath:/META‐INF/resources/", 
	 "classpath:/resources/",
	 "classpath:/static/", 
	 "classpath:/public/"
	  "/":当前项目的根路径

	  localhost:8080/abc===去静态资源文件夹里面找abc

3)、欢迎页;静态资源文件夹下的所有index.html页面;被"/"映射;**

	  localhost:8080/找index页面

4)、所有的/favicon.ico都是在静态资源文件下找;**

模板引擎

在这里插入图片描述

只要我们把HTML页面放在classpath:/templates/,thymeleaf就能自动渲染;

发布了59 篇原创文章 · 获赞 9 · 访问量 9万+

猜你喜欢

转载自blog.csdn.net/qq_43229543/article/details/103957381