1. pom.xml引入相关依赖

    <!--引入thymeleaf依赖-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
  2. 静态资源放在resources/templates/

  3. HTML文件加入头文件

    <!DOCTYPE html>
    <html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
       <meta charset="UTF-8">
       <title>title</title>
    </head>
    <body>
    
    </body>
    </html>
分类: 算法 标签: SpringBoot Thymeleaf

评论

全部评论

暂无目录