0
点赞
收藏
分享

微信扫一扫

SpringBoot系列---【如何在springboot官网找thymleaf依赖?并集成Thymeleaf】

代码小姐 2022-06-01 阅读 54

1.参照下面图片中标红的步骤

SpringBoot系列---【如何在springboot官网找thymleaf依赖?并集成Thymeleaf】_spring

 

 2.经过步骤1就拿到了每个版本最新的资料了。

SpringBoot系列---【如何在springboot官网找thymleaf依赖?并集成Thymeleaf】_spring_02

 

 3.这里以集成thymleaf为例

SpringBoot系列---【如何在springboot官网找thymleaf依赖?并集成Thymeleaf】_官网_03

 

 4.找到pom依赖,springboot内置了thymleaf,引入依赖即可使用,把静态页面放到template包下,通过controller访问

SpringBoot系列---【如何在springboot官网找thymleaf依赖?并集成Thymeleaf】_html_04

 

 

<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>

 5.此时在template包下新建html文件,并在顶部加上约束,

<html xmlns:th="http://www.thymeleaf.org">这里选择3.0的原因是springboot2.2这个版本引入的就是thymeleaf3.0,具体看点进pom的
parent的顶层
artifactId

dependencyManagement依赖管理中查看。

SpringBoot系列---【如何在springboot官网找thymleaf依赖?并集成Thymeleaf】_html_05

 

 6.按照官网的文档进行thymeleaf语法学习

SpringBoot系列---【如何在springboot官网找thymleaf依赖?并集成Thymeleaf】_官网_06

 

举报

相关推荐

0 条评论