Error resolving template [/index], template might not exist or might not be accessible by any of the configured Template Resolvers
java -jar
运行时<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-thymeleafartifactId>
dependency>
thymeleaf:
prefix: classpath:/templates/ #prefix:指定模板所在的目录
check-template-location: true #check-tempate-location: 检查模板路径是否存在
cache: false #cache: 是否缓存,开发模式下设置为false,避免改了模板还要重启服务器,线上设置为true,可以提高性能。
suffix: .html
#encoding: UTF-8
#content-type: text/html
mode: HTML5
@RequestMapping("/")
public ModelAndView indexHtml(HashMap<String, Object> map) {
ModelAndView mv = new ModelAndView("index");
return mv;
}