springboot-06-首页和图标定制

首页

直接源码分析
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
欢迎页的名字是 index.html ,静态资源文件夹下的所有 index.html 页面;被 /** 映射。

比如我访问 http://localhost:8080/ ,就会找静态资源文件夹下的 index.html

新建一个 index.html ,在我们上面的3个目录中任意一个;然后访问测试 http://localhost:8080/ 看结果!

图标定制

1.将名为favicon.ico放在任一静态资源目录下
2.在配置文件中关闭SpringBoot默认图标(高版本显示已过时)

#关闭默认图标
spring.mvc.favicon.enabled=false

3.在index.html中引入一句话

<link rel="icon" href="/favicon.ico">

4.清除缓存,重启访问测试
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_42665745/article/details/114602677