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

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

 

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

 

 3.这里以集成thymleaf为例

 

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

 

 

<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依赖管理中查看。

 

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

 

posted on 2021-01-29 00:56  少年攻城狮  阅读(1109)  评论(0)    收藏  举报

导航