<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> 需要在resource目录下创建两个目录 static 和 templates, 前者放静态资源, 后者放html文件等。 不需要再像SpringMVC那样配置视图解析器,直接开箱即用,controller返回视图即可。