Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OutputStream / Writer not flushing

 
Mike DeStefano
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic