美文网首页
解决thymeleaf严格html5校验的方法

解决thymeleaf严格html5校验的方法

作者: snailbinich | 来源:发表于2018-01-05 15:53 被阅读0次

    在spring中使用thymeleaf的时候,会对html进行严格的语法校验,实际并没有什么必要,如下是解决方法:

    1 在pom.xml文件中添加如下依赖:

    <dependency>
       <groupId>net.sourceforge.nekohtml</groupId>
       <artifactId>nekohtml</artifactId>
       <version>1.9.21</version>
    </dependency>
    

    在application.properties中添加如下属性:

    spring.thymeleaf.mode=LEGACYHTML5
    

    相关文章

      网友评论

          本文标题:解决thymeleaf严格html5校验的方法

          本文链接:https://www.haomeiwen.com/subject/ovrsnxtx.html