zoukankan      html  css  js  c++  java
  • 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语法学习

    愿你走出半生,归来仍是少年!
  • 相关阅读:
    Pika的设计及实现
    高性能网络编程
    C语言的结构体
    消息队列库——ZeroMQ
    Diffie-Hellman密钥交换算法
    mysql-proxy 读写分离
    位运算
    分布式学习之一:事务
    Redis Cluster
    SpringBoot整合ActiveMQ,看这篇就够了
  • 原文地址:https://www.cnblogs.com/hujunwei/p/14342745.html
Copyright © 2011-2022 走看看