Springboot项目启动后访问不到Controller
1、问题描述
搭建一个Springboot项目,可以正常启动和访问,但是访问就会报错:This application has no explicit mapping for /error, so you are seeing this as a fallback.
2、解决方案
在main函数启动类上加注解: @SpringBootApplication(scanBasePackages = "***") 问题即可解决。 (注释:此处的***是指你的controller所在的包的包名,之所以访问不到,就是因为没有扫描到你的controller这个包。)
