Search code examples
javaspringspring-bootlocalhost

In spring boot localhost not taking data when program is running fine on console


I am learning spring boot and trying to built my first application. Program is running fine on console. When I'm trying to add data on localhost page showing error? Alien.java

home.jsp

AlienController.java

BoojApplication.java

AlienRepo.java

application.properties

console

Error


Solution

  • The error is clear: 404 means Spring didn't find your URL.

    Your controller declares addAlien with an uppercase, while your test uses addalien with a lowercase.

    Make sure to be consistent everywhere with your declarations and your usages.

    For more informations, check this answer.