SpringBoot访问html访问不了的问题

springboot默认是不支持jsp的

注意pom.xml是否添加了thymeleaf的依赖 

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

#thymelea模板配置 这是不必要填的 填在配置文件里面默认覆盖

spring.thymeleaf.prefix=classpath:/templates/

spring.thymeleaf.suffix=.html spring.thymeleaf.mode=HTML5

spring.thymeleaf.encoding=UTF-8

spring.thymeleaf.content-type=text/html

spring.thymeleaf.cache=false

spring.resources.chain.strategy.content.enabled=true

spring.resources.chain.strategy.content.paths=/**

原文地址:https://www.cnblogs.com/LEEEEEASON/p/9273455.html