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

Posted christy99cc

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了报错An error happened during template parsing (template: "class path resource [templates/hello1(代相关的知识,希望对你有一定的参考价值。

页面显示:

Whitelabel Error Page

This 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]")
 
 

 

技术图片

 

 

 

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

正确写法:

<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(代的主要内容,如果未能解决你的问题,请参考以下文章

What happened when new an object in JVM ?

MySQL技术专题(3)MySQL报错Got an error reading communication packets问题分析指南

IE11 F12工具报错 An error has occurredJSPlugin.3005

解决mysql 8报错 ERROR 1064 (42000): You have an error in your SQL syntax

解决mysql 8报错 ERROR 1064 (42000): You have an error in your SQL syntax

关于安装centos7 报错An unknown error has occurred