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. 是否是编码问题?我这里的编码指的是代码有错误 语法等问题 !




免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM