SpringBoot试图解析器问题

配置了试图解析器后springboot仍无法解析

img

img

img

最终还是访问不上页面

img

问怎么解决这种问题

解析器要改为thymeleaf,如下:


# 配置模板存放路径
spring.thymeleaf.prefix=classpath:/templates/
#配置模板后缀
spring.thymeleaf.suffix=.html

springboot支持将静态资源文件放在如下目录:
classpath:/META-INF/resources/
classpath:/resources/
classpath:/static/
classpath:/public/
classpath:/
所以你的目录应该不符合要求吧

html丢到static下面