码迷,mamicode.com
首页 > 移动开发 > 详细

【报错】An error happened during template parsing (template: "class path resource [templates/hello1.html]")

时间:2019-12-07 01:00:19      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:nbsp   写法   技术   字符   显示   serve   height   hello   http   

页面显示:

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.html]")

标签:nbsp   写法   技术   字符   显示   serve   height   hello   http   

原文地址:https://www.cnblogs.com/christy99cc/p/12000196.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!