springboot模板引擎thymeleaf对于没有关闭标签的错误解析

来源:互联网 发布:淘宝客卖家推广教程 编辑:程序博客网 时间:2024/06/13 02:52

在使用springboot结合thymeleaf的时候,我们需要做出以下配置正确解析html:
添加pom.xml的依赖:

        <dependency>            <groupId>net.sourceforge.nekohtml</groupId>            <artifactId>nekohtml</artifactId>            <version>{随便都可以}</version>        </dependency>

application.properties文件添加以下配置:

spring.thymeleaf.mode=LEGACYHTML5
原创粉丝点击