Home SpringBoot Controller URL not recognized
Post
Cancel

SpringBoot Controller URL not recognized

Situation

Enter the URL “localhost:8080/sign-up” then, it shows 404 Error Screenshot 2024-10-06 224859

Solution

Change the path of Main class image

Reasons for the error

I placed my controller outside of the folder containing the main class so it caused the issue. To solve this, I put the controller class is in a subpackage of the main class. This allow the framework to automatically detect the controller during component scanning and register it as a bean.

This post is licensed under CC BY 4.0 by the author.