*
The moose likes Servlets and the fly likes response flush & close... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "response flush & close..." Watch "response flush & close..." New topic
Author

response flush & close...

Dave Brown
Ranch Hand

Joined: Mar 08, 2005
Posts: 301
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


Regards, Dave Brown
SCJP 6 - [url]http://www.dbws.net/[/url] - Check out Grails Forum
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

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.


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: response flush & close...