正文springboot启动正常,访问restController报404IP云V管理员/2022-12-02/0 阅读 12/02小程序:扫一扫查出行【扫一扫了解最新限行尾号】复制小程序 原因:spring boot只会扫描启动类当前包和以下的包 比如以下: 主类:Application放在包com.springboot.main controller类放在包com.springboot.controller 上面这处情况是找不到controller的 正确的做法是: Application放在包com.springboot controller类放在com.springboot.controller,这样相当于controller的在的包属于com.springboot底下。