1.如果加入了thymeleaf依赖,传统的引入静态资源的方法失去效果正确做法如下
<!-- Themeleaf -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
2.结构
1.static是专门存放静态资源的,如果把html文件也放在static中,传统的引入就可以使用,但是把html放在templates中,就必须采用thymeleaf的语法来引入,另外thymeleaf中的静态页面必须要去调用,无法直接访问,只有启动项目以后才可以访问,不启动无法解析
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">