*
The moose likes Servlets and the fly likes OutputStream / Writer not flushing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "OutputStream / Writer not flushing" Watch "OutputStream / Writer not flushing" New topic
Author

OutputStream / Writer not flushing

Mike DeStefano
Ranch Hand

Joined: May 24, 2002
Posts: 36
I have an application where I wish to write a line of text to the output stream and then flush it to the client. On websphere 0S/390 webserver, it seems that it won't flush. Instead, it waits until the servlet finishes running.

I've tried using both the response.getOutputStream and response.getWriter Objects to do this and no success. I've sen tried setBufferSize(0), but no luck...

Any ideas to get the toilet to flush would be great! Any plumbers out there?

Thanks in advance,
- Mike


-Mike Destefano<br />"Sometimes you feel like a nut..."
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
I have never had any problem with this - are you using the
java.io.OutputStream flush() method or the
javax.servlet.ServletResponse flushBuffer() method?
Bill
Mike DeStefano
Ranch Hand

Joined: May 24, 2002
Posts: 36
When I get the Object from response.getWriter(), I use the flush() method... Is there another method I didn't see called flushBuffer() that I should be using?
Mike DeStefano
Ranch Hand

Joined: May 24, 2002
Posts: 36
I've tried response.flushBuffer() along with printWriter.flush()... Any other ideas? It won't flush the buffer to the client. Does anyone have any familiarity with this problem in Websphere 3.5?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Why are you sure that the client has not gotten the data?
For example if you were writing an HTML table to a browser, it might not even try to render the table until it sees the end tag. Perhaps your client is waiting for something to show the output is finished, and waits until the servlet closes the output stream.
Bill
 
jQuery in Action, 2nd edition
 
subject: OutputStream / Writer not flushing