报错An error happened during template parsing (template: "class path resource [templates/hello1(代

会挽雕弓如满月,西北望,射天狼。这篇文章主要讲述报错An error happened during template parsing (template: " class path resource [templates/hello1(代相关的知识,希望能为你提供帮助。
页面显示:
Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing this as a fallback.
Fri Dec 06 23:26:03 CST 2019 There was an unexpected error (type=Internal Server Error, status=500). An error happened during template parsing (template: "class path resource [templates/hello1.html]")      

报错An error happened during template parsing (template: "class path resource [templates/hello1(代

文章图片

 
 
 
原因: Thymeleaf样式不符合规范。   错误写法:
< p align="center" th:text="现在de时间是${now}"> hihihi< /p>

正确写法:
< p align="center" th:text="|现在de时间是${now}|"> hihihi< /p>


【报错An error happened during template parsing (template: " class path resource [templates/hello1(代】竖线不能漏掉!指的是文本替换。
另外,用+来连接字符串也是可以的。
另一种正确的写法:
< p align="center" th:text="‘现在de时间是‘ +${now}"> hihihi< /p>

 

    推荐阅读