一.直接上解决方案吧!(不啰嗦了)
1.修改springboot版本我之前用的是2.1.4的最新版本,现在修改版本至
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.20.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
2.修改thymeleaf版本,
<properties>
<java.version>1.8</java.version>
<thymeleaf.version>3.0.9.RELEASE </thymeleaf.version>
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
</properties>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
注:不使用springboot默认导入的thymeleaf版本
有解决最新版本springboot访问html问题的小伙伴可以在我下方留言!咱们共同进步!