欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

解决thymeleaf模板中,对html标签要求太严格的问题

程序员文章站 2022-05-01 23:01:30
...

平日使用thymeleaf时,发现使用要求非常严格,比如<input type="text" />单标签结尾便会报错,只有这样<input type="text" > </input>才可以。

为了解决这种严格的使用规则,可以添加如下依赖:

<!--thymeleaf的依赖包-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

        <!--为了解决thymeleaf模板中,对html标签要求太严格的问题!-->
        <dependency>
            <groupId>net.sourceforge.nekohtml</groupId>
            <artifactId>nekohtml</artifactId>
            <version>1.9.22</version>
        </dependency>

相关标签: thymeleaf