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语法学习

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM