MVC controller is being called twice

You can step through the code in your view. Step through and see where the second call comes from.


10 hours chasing that bug in a Java Spring Maven project.

First on SELECT I thought Hibernate was just logging twice, but then with INSERT I thought requests were called twice. Stepping throught the code I discovered controller was called twice...

Tried all possible Spring configuration, thinking the context was loaded twice or a bean was instantiate twice...

In despair, rebuilded the project piece by piece to finally add a fragment of HTML and kaboom bug's back.

<img alt="" src="#" />

The sharp sign was guilty, reloading the URL. I know the topic is old, but I summarized my searchs with the words I used to look for in vain on Internet to find an answer to the same issue! Could help others...


there should be a html markeup that is not working properly. please check all img tage. also check

<link rel="icon" href="favicon.ico" type="image/x-icon" />

Is there any other markup that could be accidentally referencing the page? Script references, image references, css references, all could be mistakenly pointed at '.' or the current page.