This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

response flush & close...

 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Just wondering about the relevance of response.flush() and close();

Does it help the servlet container/client browser behave by ensuring you have a flush() or a close() after a servlet has done its main business?

Rgds,

Dave
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is best to let the container handle the stream unless you have a good reason to intervene.
[ December 14, 2005: Message edited by: Bear Bibeault ]
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an autoFlush attribute you can set on the page context to handle this.

In general, though, you only call flush() if you need to send user data during a long running process that has not completed yet. Other than that, you don't have to worry about it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic