1. 程式人生 > >thymeleaf模板對沒有結束符的HTML5標簽解析出錯

thymeleaf模板對沒有結束符的HTML5標簽解析出錯

log release 錯誤 class dia XML ase html5 結束

thymeleaf 2.X 版本對HTML5要求比較嚴格,因此必須每個標簽都有結束符。

現在有一種簡單的方法可以避免這個問題:使用thymeleaf 3.0 版本!

具體操作如下:

pom.xml 文件的<properties>添加如下版本信息:

1 <properties>
2         <thymeleaf.version>3.0.0.RELEASE</thymeleaf.version>
3         <thymeleaf-layout-dialect.version>2.0.0</thymeleaf-layout-dialect.version
> 4 5 </properties>

OK! 錯誤消失了!

thymeleaf模板對沒有結束符的HTML5標簽解析出錯