访问controller,访问不了
controller代码
配置
spring.thymeleaf.prefix=classpath:/templates
spring.thymeleaf.suffix=.html
spring.thymeleaf.cache=false
报错
Error resolving template [Index], template might not exist or might not be accessible by any of the configured Template Resolvers
解析模板[Index]时出错,模板可能不存在,或者任何已配置的模板解析程序都无法访问该模板
参考教程:https://yang-roc.blog.csdn.net/article/details/121340293
主要是弄清楚,Controller里设置模版名称的地方,以及模版页面保存地方的对应关系
看看这张图里的元素对应关系:
还不懂的话,看看我这篇文章:https://blog.didispace.com/spring-boot-learning-21-4-1/ ,比较详细的。