Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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'" />

reply
    Bookmark Topic Watch Topic
  • New Topic