do a response.setContentLength(int) before sending the html page. that will take care of it.
cheers
Anamitra
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Albert Solbes-Godina
Sent: Monday, November 08, 1999 2:37 PM
To: [EMAIL PROTECTED]
Subject: how avoid "connection reset by peer" error ?

My httpServlet makes a "connection reset by peer" error while browser is trying to load an html page. This almost always happens but it sometimes runs OK. Servlet makes too many jdbc operations and i think that this may be the cause of that error. Here you got the pseudo-code of the servlet:
 
/**
* service method
*/
public void service(HttpServletRequest req, HttpServletResponse res)   throws ServletException, IOException
{
 PrintWriter out;
 res.setContentType("text/html");
 out = res.getWriter();
...
parameter parsing
.
.
DB access via JDBC
.
.
display results in html (out.println('<results_in_html>') );
.
.
 out.flush();
 out.close();
}
 
many parts of code are distributed on different java-objects
 
what can i do?
 
thanks for all.
 
 
Albert

 
Albert i Leila

Reply via email to