1、新建springboot工程
2、添加thymeleaf依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
3、在resource下新建termplates文件夹,放置html
4、controller直接返回html,会直接跳转到html页面
注意:controller的注解一定要写“Controller”, 如果写RestController会导致返回json!