On Tue, 21 Aug 2001, Jonathan Eric Miller wrote:

> Date: Tue, 21 Aug 2001 10:47:11 -0500
> From: Jonathan Eric Miller <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: Tomcat Developer List <[EMAIL PROTECTED]>
> Subject: Fw: Bug in ServletResponse.flushBuffer() in Tomcat 4.0b7?
>
> I originally posted this to the tomcat-user list, but, I received no
> response. As far as I can tell, it's a bug, so, I'm now forwarding this to
> the developer list in hopes that someone here might be able to confirm
> whether this is a bug or not.
>
> If you know the answer and respond, please respond to me directly or post to
> the user list as I am not on this list.
>
> Thanks a lot. I think you guys are doing a great job. It's just a few small
> issues like this that I hope to resolve at this point.
>
> Jon
>

Jon,

I tried this with Tomcat 4.0 stand alone (current CVS code, Linux, JDK
1.3.1) and it works exactly as you expect -- you see the first part of the
output, followed by a ten-second delay, followed by the second part.  (Of
course, I had to put the Thread.sleep() call into a try/catch block.)

As you undoubtedly noticed, the HTML that you emit before the flush has to
be completed paragraphs or other elements -- otherwise the characters will
still get buffered inside the browser itself.  One way to ensure that the
browser is not messing you up is to do a telnet connection:

  telnet localhost 8080

and type

  GET /myapp/servlet/SimpleServlet HTTP/1.0

followed by a carriage return (^M) and line feed (^J).

Craig


Reply via email to