1.配置Thymaleaf <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> 2.添加html到templetes文件夹,方法指定 @RequestMapping("/html666") public String html() { //return的值映射html的name return "html"; }