You have no mapping for controller. Now you have only /student
as GET
and /addStudent
as POST
. Even if you add @RequestMapping("/controller")
to your controller class it will not work because there is still no mapping for /controller
.
As you can see mapping will be for /controller/student
and /controller/addStudent
. I recomend you to change requesting URL to just /student
and /addStudent
or if you need this /controller
URL you should have additional method looks like below
@RequestMapping("controller")
public String anyMethodName(Model model) {
//code goes here
return "anythink";
}