Loading

springboot--Whitelabel Error Page

两种方案
1.application.properties中增加该配置
spring.resources.static-locations=classpath:/templates/,classpath:/static
虽然默认是去templates下找,
最好明确指明先去tempplates文件夹下匹配html,然后再去statics下
2.把启动类放在最外层
SpringBoot默认会扫描启动类所在的包及其子包。
启动类是注解@SpringBootApplication标注的类,也就是要确定@Controller能被扫描到

posted @ 2021-07-08 13:16  itjone  阅读(71)  评论(0编辑  收藏  举报