idea快速创建springboot,但@RestController不起作用 原因是springboot主程序中扫描不到controller所在的包的位置 解决方案: 在springboot主程序类中加上@ComponentScan("com.zb.lq.controller") 如图: