解决:templates下面的页面不能直接访问到,需要加thymeleaf模板引擎的依赖,在源码中可以看出thymeleaf模板已经降视图解析器的前缀和后缀都定义好了,我们只需要加入其依赖就可以。
- 源码
- 依赖地址(注意版本):https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf

解决:templates下面的页面不能直接访问到,需要加thymeleaf模板引擎的依赖,在源码中可以看出thymeleaf模板已经降视图解析器的前缀和后缀都定义好了,我们只需要加入其依赖就可以。