一、导入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
二、建立HTML页面
注意:html要放在src/main/resources/templates目录下
例:编写test.html 放在上述目录下
![在这里插入图片描述](https://img-blog.csdnimg.cn/be856a92566b4f4881b5cc0ce098d90c.png#pic_center)
三、编写访问Thymeleaf的Controller
![在这里插入图片描述](https://img-blog.csdnimg.cn/d2e747c6703d4803a6626a0779dbf6f6.png#pic_center)
四、访问测试
通过http://localhost:8080/test 访问页面
![在这里插入图片描述](https://img-blog.csdnimg.cn/077b0bfb1214414da6f57a7dee029e3f.png#pic_center)