Problem Description:
Solve the problem that the SpringBoot project cannot access the Controller
. Access to the server through the browser displays a 404. This application has no explicit mapping for /error, so you are seeing this as a fallback.
Cause Analysis:
The SpringBootApplication.class file is not in the same level directory as the controller package. The @SpringBootApplication annotation in the SpringBootApplication.class file will scan all files under the package where the class is located, and can identify the Controller. If it is placed in another package, it will not be scanned Controller
solution:
The SpringBootApplication.class file and the controller package can be placed in the same directory