Spring Boot 我尝试在本地主机上查看我的HTML页面,但出现错误

ghhkc1vu  于 2023-02-08  发布在  Spring
关注(0)|答案(1)|浏览(122)

我想在我的本地主机上显示一个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>
v8wbuo2f

v8wbuo2f1#

我不知道这是一个错误的提问或实际的错误,但我认为您的HTML文档无法解析,因为第二行的"HTML代码"..
<html lang="en"缺少结束菱形:"〉"

相关问题