Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing this as

1.当遇到这个错误肯定是自己粗心了。在启动一个springBoot的小demo的时候出现了如下错误:

Whitelabel Error Page

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

Wed Nov 01 19:42:30 CST 2023

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

2.经过检查发现,原来是controller层放到了项目包的外面,导致请求无法找到对应的controller处理方法,如图:

3.将controller层移动到主启动类所在包下即可:

4.还有一种原因是没有将controller注入spring容器,也就是忘了敲@Controller
5.还有一种办法是在启动类中配置@SpringBootApplication(scanBasePackages="controller"),注明你的controller层的位置

总之,出现该错误的主要原因就是粗心了,多检查检查一些细节上的错误。

  • 4
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.是一个常见的错误页面,表示应用程序没有为/error路径设置明确的映射,因此显示了这个默认的错误页面信息。它通常出现在Web应用程序中,当访问到没有设置映射的路径时会触发这个错误。这个错误页面的目的是提醒开发者需要为这个路径设置一个映射,以便正确处理请求。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [解决:Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing ...](https://blog.csdn.net/guihua55/article/details/119831355)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [layui数据表格 table.render 报错的解决方法](https://download.csdn.net/download/weixin_38629303/14828807)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [This application has no explicit mapping for 解决方法](https://blog.csdn.net/xianyu120/article/details/120882220)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值