一、应用Maven依赖
在https://mvnrepository.com/中搜索Thymeleaf,找到最多人使用的版本,将其Maven依赖复制到pom.xml中

Maven依赖如下所示:
<!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf -->
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>3.0.9.RELEASE</version>
</dependency>
二、在HTML页面中增加头文件
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
本文介绍如何在项目中使用Maven整合Thymeleaf模板引擎,包括添加Maven依赖及在HTML页面中引入Thymeleaf命名空间。

1411

被折叠的 条评论
为什么被折叠?



