我想在我的本地主机上显示一个HTML页面。
我已经将HTML文件放入/template
文件夹,但收到以下错误:Error resolving template [Services], template might not exist or might not be accessible by any of the configured Template Resolvers
.
@Controller
public class MyController {
@RequestMapping(value = "/Services", method = RequestMethod.GET)
public String about() {
//Services.html
System.out.println("Inside About Handler");
return "Services";
}
}
Thymeleaf HTML页面
<!doctype html>
<html lang="en"
<head>
<meta charset="UTF-8" />
<title>Document</title>
</head>
<body>
<h1>about learn code</h1>
<h1>we are learning springboot</h1>
</body>
</html>
1条答案
按热度按时间v8wbuo2f1#
我不知道这是一个错误的提问或实际的错误,但我认为您的HTML文档无法解析,因为第二行的"HTML代码"..
<html lang="en"
缺少结束菱形:"〉"