在使用springboot结合thymeleaf的时候,我们需要做出以下配置正确解析html:
添加pom.xml的依赖:
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>{随便都可以}</version>
</dependency>
application.properties文件添加以下配置:
spring.thymeleaf.mode=LEGACYHTML5
本文介绍如何在SpringBoot项目中配置Thymeleaf来正确解析HTML页面,包括添加依赖及配置application.properties文件。
21万+

被折叠的 条评论
为什么被折叠?



