2015-11-02 99 views
2

我已經改變了裏面的彈簧引導的依賴,1.2.7.RELEASE.pom文件的版本,但我正在逐漸this error.I已經更新這兩個兩個標籤如何使用Spring引導

<thymeleaf.version>3.0.0.ALPHA03</thymeleaf.version> 
<thymeleaf-layout-dialect.version>1.3.1</thymeleaf-layout-dialect.version> 
更新ThymeLeaf

回答

4

它已經發布了一段時間,但希望這將有助於其他人。截至目前Springboot不能自動配置Thymeleaf 3.0。您需要排除ThymeleafAutoConfiguration類並提供您的自定義配置。有可能是指在以下網址有據可查的步驟:

https://gist.github.com/seanhinkley/6eab2130ceea857c160b

佈局方言不是由Thymeleaf團隊管理它仍然是一個懸而未決的問題。

https://github.com/ultraq/thymeleaf-layout-dialect/issues/68

另一種選擇是等到Springboot正式支持Thymeleaf 3.0。

更新:

Springboot增加了支持爲Thymeleaf 3.0的自動配置,在1.4.x的版本。默認情況下,Springboot仍然使用Thymeleaf 2.1,但可以將其配置爲使用3.0。

<properties> 
    <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version> 
    <thymeleaf-layout-dialect.version>2.1.1</thymeleaf-layout-dialect.version> 
</properties> 

參考官方文檔:

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-use-thymeleaf-3

參考樣本:

https://github.com/spring-projects/spring-boot/tree/v1.5.6.RELEASE/spring-boot-samples/spring-boot-sample-web-thymeleaf3