Issue
I'm using an apache tomcat server
, on doing a project all my get request methods are hitting twice without initiating the call manually. If i call a method, on its return the method is being called again automatically. I have tried many ways but it doesn't helps me. This project is a same copy of another working project, however the old project is working fine.
I have tried these following answers, but this couldn't solve my problem
I have also verified if any of my scripts is initiating the second call, but there is no scripts like that. Can anyone helps me out?
Sample code of my method
@RequestMapping(value = "/method/test/{id}/{name}", method = RequestMethod.GET)
public String getTestMethod(@PathVariable int id, @PathVariable String name, Model model, HttpServletRequest request, HttpServletResponse response, RedirectAttributes ra)
{
System.out.println("success");
return "success";
}
Solution
I had the same problem. Then I have changed href="Favicon.ico"
to empty in my index.html
file. Then it worked. Change it to href=""
.
Answered By - Fredo MG