Possible reasons:
* You are opening an HTML element like <table> or <p> and not closing it
before the flush, and writing to a browser that does not incrementally
render (like Netscape 4.x).
* You are using a web connector that does its own buffering.
* There is a proxy or something in between.
* Bug in 4.1.10 (submit a bug report).
Counting on incremental output being visible is a very chancy bet.
Craig
On Tue, 10 Sep 2002, Samuel Cheung wrote:
> Date: Tue, 10 Sep 2002 22:38:15 -0500
> From: Samuel Cheung <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: 'Tomcat Users List' <[EMAIL PROTECTED]>
> Subject: RE: HttpResponseBase.sendRedirect vs JetSpeed
>
> Craig,
> Thanks. But when i try to call the flush() method incrementally during the
> execution of the doGet(), the client does not display anything. The browser
> keeps loading and displayed everything at the end. I am using Tomcat 4.1.10
> for this example.
>
> Thanks for your help.
> Sam
>
> public void doGet() {
> int count = 0;
> response.setBufferSize(1);
> PrintWriter out = response.getWriter();
>
> for (int i= 0; i < 10; i++) {
> out.println("<h1> Count: ");
> out.println(count++);
> out.println("</h1>");
>
> System.out.println ("print log count:" + count);
> out.flush();
> response.flushBuffer();
>
> Thread.sleep(5000);
> }
>
> -----Original Message-----
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 10, 2002 10:28 PM
> To: Tomcat Users List
> Subject: RE: HttpResponseBase.sendRedirect vs JetSpeed
>
>
> Yes, you can call writer.flush() or response.flushBuffer().
>
> See the servlet spec for all the details:
>
> http://java.sun.com/products/servlet/download.html
>
> Craig
>
>
> On Tue, 10 Sep 2002, Samuel Cheung wrote:
>
> > Date: Tue, 10 Sep 2002 18:04:00 -0500
> > From: Samuel Cheung <[EMAIL PROTECTED]>
> > Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> > To: 'Tomcat Users List' <[EMAIL PROTECTED]>
> > Subject: RE: HttpResponseBase.sendRedirect vs JetSpeed
> >
> >
> > Does the servlet spec allows servlets to flush() the outputStream of the
> > HTTP response class?
> > Or it will be ignored by the container as well?
> >
> > Thanks.
> >
> >
> > -----Original Message-----
> > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, September 10, 2002 5:53 PM
> > To: Tomcat Users List
> > Subject: Re: HttpResponseBase.sendRedirect vs JetSpeed
> >
> >
> > Per the servlet spec, it is not legal to modify HTTP headers from inside
> > an include (either RD.include() or <jsp:include)), and any such attempt
> > will be ignored by the container.
> >
> > You can certainly build Tomcat from source and make the modification
> > you're talking about in your copy, but you'll be making your copy
> > non-spec-compliant if you do.
> >
> > Craig
> >
> >
> > On Tue, 10 Sep 2002, Erich Bratton wrote:
> >
> > > Date: Tue, 10 Sep 2002 17:22:59 -0500
> > > From: Erich Bratton <[EMAIL PROTECTED]>
> > > Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED]
> > > Subject: HttpResponseBase.sendRedirect vs JetSpeed
> > >
> > >
> > > Hi,
> > >
> > > We're working on getting JetSpeed up and running with some portlets
> using
> > > Velocity and some using JSP. We are seeing behavior where, even using
> > Tomcat
> > > 4.1 with a bufferSize set to 100k, when a JSP page calls
> > > response.sendRedirect(), nothing happens.
> > >
> > > The problem appears to be in HttpResponseBase, lines 1132-1133, where it
> > checks
> > > to see if it is being called from a RequestDispatcher.include() and if
> so,
> > it
> > > just returns and silently does nothing. This behavior seems odd, since
> > lines
> > > 1128-1130 check to see if the response has been committed already, and
> if
> > so, it
> > > throws an Exception.
> > >
> > > Having said all this, is this a bug? Is there a way to configure this
> > behavior
> > > from a config file somewhere? Is there a way for us to compile a
> version
> > of
> > > HttpResponseBase with lines 1132-1133 commented out and for us to drop
> it
> > > somewhere in the Tomcat hierarchy where it will 'override' the default
> > Tomcat
> > > version of HttpResponseBase?
> > >
> > > Thanks for any and all ideas,
> > >
> > > --Erich
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>