https://www.bilibili.com/video/BV1gW411W76m?p=1
1.使用Spring Boot
1)创建Spring Boot,选择需要的工程
2)SpringBoot已经默认将这些场景配置好了,只需要在配置文件中指定少量配置就可运行
3)自己编写业务逻辑代码
2.springboot对静态资源的映射规则
1)所有/webjars/**,都去classpath:/META-INF/resources/webjars/找资源(自动引入资源)
webjars:以jar包的方式引入静态资源 https://www.webjars.org/
localhost:8080/webjars/jquery/3.3.1/jquery.js
引入webjars的jQuery
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.3.1</version>
</dependency>
2)/**访问当前的默认资源(静态资源的文件夹)
classpath:/META-INF/resources/
classp:/resources/
classpath:/static/
classpath:/public/
/ 当前项目的根路径
localhost:8080/abc ===去几个静态资源目录里找ABC文件
3)首页欢迎页:静态资源文件夹下的/index.html文件页面;被/**映射
localhost:/ 找index.html
4)网页图标设置 **/favicon.ico
所有的**/favicon.ico都是在静态文件夹找
3.配置静态文件路径
spring.resources.static-locations=classpath:/hello/,classpath:/XXX/