springboot--Whitelabel Error Page

时间:2021-07-08 18:25:52   收藏:0   阅读:24

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

原文:https://www.cnblogs.com/itjone/p/14985634.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!