结构
1.引入依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
2.在yml文件配置
spring: thymeleaf: mode: HTML encoding: UTF-8 prefix: classpath:/templates/ suffix: .html
3.Controller
@Controller public class IndexController { @GetMapping("/") public String index(){ return "login"; } }
标签:springboot,spring,boot,thymeleaf,访问,Controller,public,页面 From: https://www.cnblogs.com/Amywangqing/p/17590505.html