2015-11-02 102 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