SpringBoot中的thymeleaf引擎报错

关于:thymeleaf报错:

An error happened during template parsing (template: "class path resource [templates/hello.html]")] with root cause......

一下的每个都为单个的解决办法! 并非步骤!

1.清除你编译器编译器缓存!并进行重启

2.清除浏览器的缓存 ctrl+shift + del

3.检查配置文件(.pom文件):是否包含依赖 如果没有请添加!

 

 <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

4. 对application.properties中

#设置前缀和后缀
spring.thymeleaf.mode=HTML
spring.thymeleaf.suffix=.html
spring.thymeleaf.prefix=classpath:/templates/

5. 是否是编码问题?我这里的编码指的是代码有错误 语法等问题 !



原文地址:https://www.cnblogs.com/gu-bin/p/11131881.html