原文博客:https://blog.csdn.net/qq_41692413/article/details/81746103
将spring.thymeleaf.mode=HTML5(此行不写或这样写则表示默认严格检查)
改成spring.thymeleaf.mode=LEGACYHTML5
注意点:LEGACYHTML5必须是在引入了一个nekohtml依赖后,才起作用,所示必须依赖这个包
<!--为了使thymeleaf对html5非严格检查,LEGACYHTML5起作用--> <dependency> <groupId>net.sourceforge.nekohtml</groupId> <artifactId>nekohtml</artifactId> <version>1.9.22</version> </dependency>