解决方法
添加配置
thymeleaf
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.cache=false
spring.thymeleaf.servlet.content-type=text/html
spring.thymeleaf.enabled=true
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.mode=HTML
spring.thymeleaf.check-template-location=true
静态文件请求匹配方式
spring.mvc.static-path-pattern=/**
修改默认的静态寻址资源目录
#spring.resources.static-locations = classpath:/templates/,classpath:/resources/,classpath:/static/,classpath:/public/
热部署生效
spring.devtools.restart.enabled=true
pom.xml里修改
如果是用的是getmapping和postmapping 改为requestmapping