• Post Reply Bookmark Topic Watch Topic
  • New Topic

When is a response committed  RSS feed

 
Nila dhan
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if my question is correct or incorrect.When is a response committed?I mean under what circumstances?
 
Scott Selikoff
author
Bartender
Posts: 4081
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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'.
 
Nila dhan
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nila, you are correct. If in the process of writing to the response the buffer gets full, it will be implicitly flushed.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!