模板使用
Spring Boot 2.0 将布局单独提取了出来,需要单独引⼊入依赖:thymeleaf-layout-dialect
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>nz.net.ultraq.thymeleaf</groupId>
<artifactId>thymeleaf-layout-dialect</artifactId>
</dependency>
⾸先定义一个代码⽚段 copyright.html,放到 layout 目录下:
<footer th:fragment="copyright">
© 2018