环境:

       jdk1.8+

       maven3.2+

       Spring Tool Suite (STS)

mavne 相关依赖:

<dependencies>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
  </dependency>

  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
   </dependency>
</dependencies>

 

1、springboot 默认的在resource下有两个文件  static 、templates

2、在application.yml中配置thymleaf

cache在开发阶段最好是调成false,频繁的修改页面有可能缓存影响效果,如果在开发环境下可以设置为true

 3、controller

4、页面

效果: