Whitelabel Error Page This application has no explicit mapping for /error, so 避坑!!!

互联网真是个鱼龙混杂的地方,抄博客的时候能不能先实验一下再抄。想找个正确的解决方法还是要看官方文档的,springboot项目:

报错如下:

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Nov 15 11:41:07 CST 2018

There was an unexpected error (type=Not Found, status=404).

No message available

错误原因:

代码结构与官方不符:

解决方法:改一下目录结构:

把application.java放在项目根目录下:

猜你喜欢

转载自blog.csdn.net/Leo_libin/article/details/84101663