springboot用的是thymeleaf模板,是静态页面,开发时出现找不到html页面的可能出现原因及解决方法如下:

 

1. 需引入thymeleaf坐标

 

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

 

2. 配置文件配置类似jsp前缀后缀

 

spring:

  #thymeleaf start
  thymeleaf:
    mode: HTML5
    encoding: UTF-8
    content-type: text/html
    #开发时关闭缓存,不然没法看到实时页面
    cache: false
  #thymeleaf end

 

 

注: 不引入thymeleaf jar包是找不到页面的,还有就是url名不能和页面名一样;

 

 

完。

 

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐