调试springboot程序,浏览器地址栏搜索会请求两次,导致sql插入异常。
经过逐一排查,在ie浏览器和postman不会出现错误,最后发现是edge浏览器的一个endnote插件导致的!!!
Though it is old thread but my answer may help someone. Today I faced the same issue. My particular servlet is working fine earlier and suddenly it has started calling doGet method twice. On investigation, I found that my chrome browser has html validator extension which is calling the servlet again with same request to do html validation. After I disabling the extension, the problem got resolved.
具体原因还未了解。希望有所帮助。