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

页面显示:

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>

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

时间: 2024-08-29 11:01:36

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

【已解决】unity4.2.0f4 导出Android工程报错:Error building Player: ArgumentException: Illegal characters in path.

你看到的这个文章来自于http://www.cnblogs.com/ayanmw 使用unity3D开发的一个客户端,需要导出为Android工程,然后接入一些第三方android SDK. unity版本 操作系统为: OS 名称: Microsoft Windows 7 旗舰版 OS 版本: 6.1.7601 Service Pack 1 Build 7601 OS 制造商: Microsoft Corporation OS 配置: 独立工作站 OS 构件类型: Multiprocessor

报错configure:error: no acceptable C compiler found in $PATH。。

查看日志: 出错原因:新安装的linux系统,没有gcc库 解决方案:使用yum install gcc,然后发现另外个坑,没有gcc 接着解决没有gcc: http://www.cnblogs.com/dieyaxianju/p/7582270.html

Thymeleaf 异常:Exception processing template &quot;index&quot;: An error happened during template parsing (template: &quot;class path resource [templates/index.html]&quot;)

Spring Boot 项目,在 Spring Tool Suite 4, Version: 4.4.0.RELEASE 运行没有问题,将项目中的静态资源和页面复制到 IDEA 的项目中,除了 IDE 不同,其他基本相同. 运行 IDEA 中的项目,然后访问,出现异常: Exception processing template "index": An error happened during template parsing (template: "class path

Android4.4.4 GZIPOutputStream报错:Stream error

在android 4.4.4 机器上使用网友提供的GZipUtils方法进行GZip压缩,但是会一直报错Stream error.错误位置: public static void compress(InputStream is, OutputStream os) throws Exception { GZIPOutputStream gos = new GZIPOutputStream(os); int count; byte data[] = new byte[BUFFER]; while (

Laravel 5.4 migrate报错:Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `us ers_email_unique`(`email`))

Laravel 5.4 migrate报错:Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `us     ers_email_unique`(`email`)) public function up() { Schema::create('users', function (Blu

连接mysql报错:error 2003 (hy000):can&#39;t connect to mysql server on &#39;localhost&#39; (10061)

一.mysql 的bin目录下有个MySQLInstanceConfig.exe,运行就可以进行创建数据库实例,创建实例时也可以生成windows 服务,把服务设置成自动启动就可以了 二.安装在D盘的discuzz!打开后出现上述错误,请问应如何处理?winmysqladmin已经启动,但三色树上有一个小红点如果出现"ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)",说明你的MySQL还没有启动.解决办法

[Qt解错篇]报错:error: undefined reference to vtable for ClassName

一.问题描述: 编译工程时报错:error: undefined reference to vtable for ClassName,如图示: 二.问题分析: 造成这种错误的原因很多,甚至在纯C++编程过程中也可能出现.下面根据自己情况,具体问题具体分析. 原因:在原先没有Q_OBJECT关键字的工程中添加了该关键字,但是没有执行qmake,直接编译导致出现该错误. 三.例子: 原先工程的类建立: class CAppConfig { public: CAppConfig(void); CApp

Centos安装fabric 报错:error: ‘FFI_DEFAULT_ABI’ undeclared (first use in this function)

Centos安装fabric 报错: error: 'FFI_DEFAULT_ABI' undeclared (first use in this function) 需要安装libffi-devel Debian或Ubuntu需要安装 libffi-dev

VS2013编译protobuf报错:error C4996: &#39;std::_Copy_impl&#39;: Function call with parameters that may be unsafe

今天碰到这个问题,网上找了好久, 解决方法如下 VS2013编译protobuf报错:error C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe 方法一 右键点击工程 -> 属性 -> C/C++ -> 常规 -> SDL检查 改为:否 (/sdl-) 编译 O了! 方法二 右键点击工程 -> 属性 -> C/C++ ->预处理器 添加宏定义 _SCL_SECUR