Sorry, my mistake, bug has been fixed in 3.3 dev.  Just have to wait for the
next stable version I suppose.

Oh and the buffer calls are part of the 2.2 Servlet spec.

thanks,

- Dale

On Sun, Jan 21, 2001 at 07:03:43PM +0000, [EMAIL PROTECTED] wrote:
> I think they may be tomcat specific?
> 
> thanks,
> 
> - Dale
> 
> $ export CLASSPATH=~/proj/jakarta-tomcat-3.2.1/lib/servlet.jar 
> $ javap javax.servlet.ServletResponse
> Compiled from ServletResponse.java
> public interface javax.servlet.ServletResponse 
>     /* ACC_SUPER bit NOT set */
> {
>     public abstract void flushBuffer() throws java.io.IOException;
>     public abstract int getBufferSize();
>     public abstract java.lang.String getCharacterEncoding();
>     public abstract java.util.Locale getLocale();
>     public abstract javax.servlet.ServletOutputStream getOutputStream() throws
> java.io.IOException;
>     public abstract java.io.PrintWriter getWriter() throws java.io.IOException;
>     public abstract boolean isCommitted();
>     public abstract void reset();
>     public abstract void setBufferSize(int);
>     public abstract void setContentLength(int);
>     public abstract void setContentType(java.lang.String);
>     public abstract void setLocale(java.util.Locale);
> }
> 
> On Sun, Jan 21, 2001 at 10:19:58AM -0800, Craig O'Brien wrote:
> > Excuse my confusion but,  HttpServletResponse does not contain the methods
> > setBufferSize() or flushBuffer().  Did you leave these out of your example?
> > 
> > Also, If you set a buffer size to 0 would there be anything there to flush?
> > 
> > Regards,
> > Craig
> > 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, January 21, 2001 9:41 AM
> > To: [EMAIL PROTECTED]
> > Subject: Buffering of servlet responses
> > 
> > 
> > Hi,
> > 
> > Apologies if this has been asked before but the search on the mailing list
> > archive directs to port 9999 at the moment which I cannot access from behind
> > my firewall.
> > 
> > I'm trying to get the small servlet 'push' example below working but tomcat
> > appears to ignore the requests to flush it's buffers.
> > 
> > The content does not leave the server until the page is finished.
> > 
> > I'm guessing that people must be already doing this sort of thing, so what
> > have
> > I missed?
> > 
> > Tomcat: 3.2.1
> > JDK: 1.2.2
> > OS: Linux 2.2.18
> > 
> > thanks,
> > 
> > - Dale
> > 
> > import javax.servlet.*;
> > import javax.servlet.http.*;
> > import java.io.*;
> > 
> > public class TestPushServlet extends HttpServlet {
> >     public void doGet(HttpServletRequest req, HttpServletResponse resp) {
> >         try {
> >             resp.setBufferSize(0);
> >             resp.setContentType("text/html");
> > 
> >             PrintWriter out = resp.getWriter();
> > 
> > 
> > out.println("<html><head><title>TestPushServlet</title></head><body>");
> > 
> >             for (int i = 0; i < 10; i++) {
> >                 Thread.sleep(2000);
> >                 out.println(i + "<br>");
> >                 out.flush();
> >                 resp.flushBuffer();
> >             }
> >             out.println("</body></html>");
> >         } catch (Exception ex) {
> >             ex.printStackTrace();
> >         }
> >     }
> > }
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to