一、修改thymeleaf属性配置
spring.thymeleaf.prefix=classpath:/templates/spring.thymeleaf.suffix=.htmlspring.thymeleaf.mode=LEGACYHTML5spring.thymeleaf.encoding=UTF-8spring.thymeleaf.content-type=text/htmlspring.thymeleaf.cache=false
二、添加依赖(LEGACYHTML5需要搭配一个额外的库NekoHTML才可用)
<dependency> ????????<groupId>net.sourceforge.nekohtml</groupId> ????????<artifactId>nekohtml</artifactId> ????????<version>1.9.22</version> ?</dependency> ?
thymeleaf 模板使用 之 解决因HTML标签未闭合引起的错误
原文地址:https://www.cnblogs.com/zxguan/p/8342048.html