thymeleaf Exception parsing document: template="xxxx"錯誤


Thymeleaf模板引擎,遇到不閉合標簽會報這個錯誤,很是蛋疼啊。最后發現是自動生成的meta標簽沒有關閉,也是醉了。

 

解決方案:

1. 添加maven依賴

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

2. 更改application.properties屬性

spring.thymeleaf.mode=LEGACYHTML5


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM