tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jiang, Peiyun" <Peiyun.Ji...@nrc-cnrc.gc.ca>
Subject tomcat not sending all output
Date Fri, 03 Dec 2004 14:28:51 GMT
I have a servlet that is doing a lot of work. After the work is done, I send
out information to say that the work is done. But somehow tomcat
disconnected and the browser is not getting the whole output. I logged the
whole process and it does run to end. If I reduce the amount of work done by
the middle process, everything is OK. I'm confuded and could not figure out
why. Please help.

(1) Who decide to disconnect? Tomcat or the browser? I guess when the
processing is going, the browser may treat the server as NOT RESPONDING. 
(2) How to keep the connection alive?

Thanks.

Peiyun

------------------------------------------------
The simplified code is like this:

MyServlet {

 response.setContentType("text/html");
 out = request.getWriter();

 out.println("something out");
 logger.debug("step 1: we got here");

 OtherClass.doOtherStuff();//this takes a few minutes (1-5 min)

 logger.debug("step 2: some other things")
 out.println("some other thing out");

 out.flush();
}
----
class OtherClass {

  doOtherStuff() {
    logger.debug("1. got here");
       //do a lot
    logger.debug("2. got here");
  }

}
---------------------------
log file output:
step 1: we got here
1. got here
2. got here
step 2: some other things
--------------------------
browser output:
something out
--------------------------
expected browser output:
something out
some other thing out






---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message