当前位置:网站首页>Whitelabel Error Page访问
Whitelabel Error Page访问
2022-06-29 14:11:00 【get-yuan】

运行springboot的时候访问接口报错,如上图所示,后端controller层代码如下:
package com.hu.sprintboot01.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/hello")
public class HelloController {
@GetMapping("/hello")
@ResponseBody
public String hello(){
return "hello";
}
}访问localhost:8080/hello/hello地址却会报异常,后面发现是异常原因是因为IDEA目录结构的问题,Application启动类的位置不对,要将Application类放在最外侧,即包含所有子包 。而我的controller则放在了最外层的包里面。导致找不到页面。

修改完controller层 的位置之后再次访问该接口,页面显示正常。


边栏推荐
- 灵感收集·创意写作软件评测:Flomo、Obsidian Memo、Napkin、FlowUs
- Laravel - Composer 安装指定 Laravel 版本
- 《canvas》之第14章 物理动画
- matplotlib直方图,柱状图
- 【Try to Hack】vulnhub DC2
- 强大、优秀的文件管理软件评测:图片管理、书籍管理、文献管理
- tcpdump如何对特定的tcp标志位进行过滤
- 在同花顺上开户安全吗 开户在哪里申请
- 疯狂的数字藏品,下一个造富神话?
- Uncover the secret! Pay attention to those machines under the membership system!
猜你喜欢

Wechat applet: new and exclusive cloud development wechat group contacts

Campus errands wechat applet errands students with live new source code

传输层 用户数据报协议(UDP)

"Dead" Nokia makes 150billion a year

微信小程序:云开发表白墙微信小程序源码下载免服务器和域名支持流量主收益

台式机主板上保护cpu的盖子安装和拆卸

动荡的中介生意,不安的租房人

“死掉”的诺基亚,一年躺赚1500亿

Investors fell off the altar: 0 sales in half a year, transferred to business and delivered takeout

Transport layer user datagram protocol (UDP)
随机推荐
Redis的事务机制
go-zero微服务实战系列(七、请求量这么高该如何优化)
[blackduck] configure the specified Synopsys detect scan version under Jenkins
【Try to Hack】vulnhub DC2
传输层 用户数据报协议(UDP)
redis 分片集群搭建与使用教程
数字IC手撕代码--交通灯
利用多态实现简单的计算器
Goby full port scan
一次mysql的.ibd文件过大处理过程记录
Stable currency risk profile: are usdt and usdc safe?
GWD:基于高斯Wasserstein距离的旋转目标检测 | ICML 2021
留给比亚迪的时间还有三年
Underlying implementation principle of five data structures of redis
单项数据流之子组件修改父组件的值
Stm32 mbed tutorial (IV) --pwm
瑞达期货可以开户吗?安全可靠吗?
常用postgresql数据操作备忘:时间
uniApp问题清单与经验
微信小程序:云开发表白墙微信小程序源码下载免服务器和域名支持流量主收益