Spring controller method called twice

I have also observed one GET request causing the controller method to execute twice. The problem occurred when requesting the service using a Chrome browser (the problem did not occur when using Postman). In my case the culprit was the JSONView Chrome extension.

I determined the cause by using the Network tab of the Chrome developer tools. It showed my GET service being requested two times. The second request was initiated by content.js, which is a JavaScript file bundled with JSONView.

After I disabled the JSONView extension, a GET request through Chrome would cause the controller method to execute only once.


I experienced this called-twice phenomenon because BrowserSync replayed HTTP requests in each open BrowserSync browser window.