【问题标题】:Thymeleaf th:include doesn't work after update to Spring Boot 1.3Thymeleaf th:include 在更新到 Spring Boot 1.3 后不起作用
【发布时间】:2016-06-16 16:39:50
【问题描述】:

我有一个application,它适用于 Spring Boot 1.2.6。现在我尝试 1.3.5 并遇到问题,以下语句不再起作用:

<head >
    <title th:text="#{app.title} + ' - ' + #{login.title}"></title>
    <th:block th:include="main::head"/>
</head>

我可以在 Thymeleaf 日志中看到找到了 main.html。此外,评估来自head 的 Thymeleaf 表达式。浏览器中的 html 如何在头部没有内容,既没有标题也没有来自 main.html 的内容。 据我所知,Thymeleaf version 没有改变。 那么可能是什么原因呢?

【问题讨论】:

  • 检查具有不同 Thymeleaf 版本的 JAR 的类路径。我还建议启用调试消息,它们可能会显示一些有用的东西。

标签: spring spring-boot thymeleaf


【解决方案1】:

Layout 方言的版本已更改。所以我将属性&lt;thymeleaf-layout-dialect.version&gt;1.2.9&lt;/thymeleaf-layout-dialect.version&gt; 添加到我的 pom.xml 中,一切都很好。

我为此创建了一个issue

【讨论】:

    猜你喜欢
    • 2020-11-05
    • 1970-01-01
    • 2016-05-01
    • 2014-07-04
    • 2015-04-26
    • 2017-02-28
    • 2017-09-17
    • 2016-04-11
    • 2018-06-03
    相关资源
    最近更新 更多