aspose file tools*
The moose likes Servlets and the fly likes When is a response committed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "When is a response committed" Watch "When is a response committed" New topic
Author

When is a response committed

Nila dhan
Ranch Hand

Joined: Sep 15, 2005
Posts: 161
I am not sure if my question is correct or incorrect.When is a response committed?I mean under what circumstances?
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

If by committed you mean sent to the user, it happens at the end of a servlet call or if a flush() of the output stream is invoked.

One common use of flush() is to output data to the screen for the user to see before a long process is complete, such as a task that would require the user to wait 5 minutes. Its preferable to give them an update status during that 5 minutes than having them watch a screen that just says 'loading'.


My Blog: Down Home Country Coding with Scott Selikoff
Nila dhan
Ranch Hand

Joined: Sep 15, 2005
Posts: 161
The response is also committed when the buffer gets filled if i am right.
Are there any other cases when a response is committed without calling flush or forwarding the response?
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Nila, you are correct. If in the process of writing to the response the buffer gets full, it will be implicitly flushed.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When is a response committed