my dog learned polymorphism*
The moose likes BEA/Weblogic and the fly likes IE submit duplicated request (randomly) and Weblogic throws Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "IE submit duplicated request (randomly) and Weblogic throws "Connection reset by peer..." exception" Watch "IE submit duplicated request (randomly) and Weblogic throws "Connection reset by peer..." exception" New topic
Author

IE submit duplicated request (randomly) and Weblogic throws "Connection reset by peer..." exception

Ping Li
Greenhorn

Joined: Sep 06, 2005
Posts: 19
Dear JavaRancher:

I have a login jsp page that logs user’s login history in the database, I just found out that there is duplicated logging information inserted in the database with a single login action. It happens randomly when using IE (version 6).

Every time when a double logging happens, it is always associated a server (weblogic 6) side exception: "javax.servlet.jsp.JspException: Connection reset by peer: socket write error". I debugged into the service (strut action source code) and found that the same request has been submitted to the service twice. It seems that IE browser abruptly drops the existing connection to the server and immediately requests the same page again (in this case, IE send duplicated login request to the server).

The duplicated request issue does not happen when using Firefox.

I don’t know how to fix the problem , your help is highly appreciated.

By the way I am using struts1.1:

The jsp form used is something similar like this:

<html:form action="/login/login.do" focus="accountNumber" >
<html:text property="accountNumber" maxlength="50" title="accountNumber"/>
...

<INPUT TYPE=image SRC="BtnLogin.gif" onClick="return verifyTerms(); " onMouseOver="this.src='BtnLogin_mo.gif'" onMouseOut="this.src='BtnLogin.gif'" />
</html:form>
Ping Li
Greenhorn

Joined: Sep 06, 2005
Posts: 19
Additional information, the javascript function the form used is:

<SCRIPT LANGUAGE="JavaScript1.1" >
function verifyTerms()
{
if ( ....)
{
alert("The terms and conditions\nmust be accepted to login.");
return false;
}
document.forms[0].submit();
return true;
}
</SCRIPT>
Ping Li
Greenhorn

Joined: Sep 06, 2005
Posts: 19
Issue solved.

Based on my research and online information, it’s mostly like an IE bug. IE browser abruptly drops the existing connection to the server and immediately requests the same page again. In my jsp file, submit action is emitted from JavaScript function, this implementation somehow triggers IE bug. So I removed submit() call from javascript function, instead, submit() is called from submit button's onClick="....; submit();...", after that, the duplicated submission problem disappeared.

Here is code after modification:

<INPUT TYPE=image SRC="...BtnLogin.gif" onClick="return verifyTerms(); submit(); this.disabled=’true’; " onMouseOver="this.src='...BtnLogin_mo.gif'" onMouseOut="this.src='...BtnLogin.gif'" />

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IE submit duplicated request (randomly) and Weblogic throws "Connection reset by peer..." exception