升级的Spring Boot Starter Parent-Thymeleaf方言布局:装饰器损坏

时间:2018-08-16 11:32:52

标签: java spring spring-boot thymeleaf

我使用spring-boot-starter-thymeleaf软件包将Spring Boot Starter Parent从1.3.3.RELEASE升级到了当前的2.0.4.RELEASE。升级后,属性layout:decorator不再起作用。该属性未解析,而是包含未解析的内容,例如

<!DOCTYPE HTML>
<html
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="layouts/admin.layout">
<head>
    <title>Admin</title>
</head>
<body>

下面包含pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.j</groupId>
<artifactId>yggdrasil</artifactId>
<version>1</version>
<name>Yggdrasil</name>
<packaging>war</packaging>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.4.RELEASE</version>
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.7</java.version>
</properties>

<dependencies>
    <!-- Spring Boot -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <!-- Spring Boot Test -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <!-- Spring Security -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>

    <!-- Thymeleaf -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>


    <!-- Web Jar libraries -->
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>jquery</artifactId>
        <version>2.1.4</version>
    </dependency>
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>bootstrap</artifactId>
        <version>3.3.2</version>
    </dependency>
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>bootswatch-sandstone</artifactId>
        <version>3.3.2</version>
    </dependency>

    <!-- WAR packaging -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>provided</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/log4j/log4j -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

    <!-- Local dependencies -->


    <dependency>
        <groupId>com.j</groupId>
        <artifactId>f</artifactId>
        <version>1</version>
    </dependency>


    <dependency>
        <groupId>com.j</groupId>
        <artifactId>bl</artifactId>
        <version>1.0</version>
    </dependency>


    <dependency>
        <groupId>com.j</groupId>
        <artifactId>dc</artifactId>
        <version>1.0</version>
    </dependency>


    <dependency>
        <groupId>com.j</groupId>
        <artifactId>ss</artifactId>
        <version>1</version>
    </dependency>


    <dependency>
        <groupId>com.j</groupId>
        <artifactId>ff</artifactId>
        <version>1</version>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>

        <!-- Tomcat plugin -->
        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <url>SECRET</url>
                <server>Jengu Saturnus</server>
                <username>SECRET</username>
                <password>SECRET</password>
                <update>true</update>
                <systemProperties>
                    <spring.profiles.active>production</spring.profiles.active>
                </systemProperties>
            </configuration>
        </plugin>   
    </plugins>
    <finalName>${project.artifactId}</finalName>
</build>

Spring Boot Starter Parent 2.0.4.RELEASE中对方言还有更多要求吗?

1 个答案:

答案 0 :(得分:0)

更新: 好像软件包nz.net.ultraq.thymeleaf.LayoutDialect没有通过spring-boot-starter-thymeleaf添加到类路径中?但是当我添加时:

<dependency>
<groupId>nz.net.ultraq.thymeleaf</groupId>
<artifactId>thymeleaf-layout-dialect</artifactId>
<version>2.3.0</version>
</dependency>

它已加载到POM