就是缺少了依賴,添加以下依賴
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
還是不行,那可能就是html沒有引號thymeleaf頭部
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" >
<head>
<head>
<title>Good Thymes Virtual Grocery</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<p th:text="${title}"></p>
</body>
</html>