After the start of the project controller springboot not be scanned

Xiao Bian recently published interfaces use when springboot met, access to 404 questions, mainly because the controller is not being scanned due to

    Why not be scanned, mainly due to the positional relationship between startup and controller wrong.

    

 

Assurance: Start and Controller classes have a common parent package. The above figure myproject.

Another solution:

    Increase @ComponentScan comment

Startup and controller no common parent package, you need to increase @ComponentScan comment on the boot.

 

Guess you like

Origin www.cnblogs.com/javabianhua/p/11884671.html