springboot项目启动无法访问到controller原因之一:引导类位置有问题

新建的springboot项目启动后,无法访问到controller

页面是404错误

查看项目结构,发现是新建工程的启动类位置有问题,controller类应该位于引导类的同级包或者子级包中。需要将下图的引导类放在com.alphajuns包下即可访问controller

原文地址:https://www.cnblogs.com/alphajuns/p/10808835.html