Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in 'response committed' in 'jsp:forward' - HFSJ pg 412

 
Arvind Sampath
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When will the response actually get committed? As far as I know, the response will be flushed if the flush() method is invoked explicitly or the response in the buffer is more than the buffer size. Am I right and/or is there something that i left?

HFSJ pg:412 says in reference to <jsp:forward>
When a forward happens, the resource to which the request is forwarded starts with a clear response buffer! In other words, anything written to the response buffer is thrown out.


Is this behaviour guaranteed assuming i dont invoke flush() explicitly? If so, how is <jsp:forward> different from RequestDispathcer forward() in this regard?

Cheers,
Arvind
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

There is no difference in the Requestdispatcher and the jsp forward method. The response is commited means all the headers are written to the client. You can do explicilty by using flushBuffer, flush, or reset on the response. The container can implicitly commit the response if the buffer is full.

Thanks
 
Arvind Sampath
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Narendra Dhande:
Hi,

There is no difference in the Requestdispatcher and the jsp forward method. The response is commited means all the headers are written to the client. You can do explicilty by using flushBuffer, flush, or reset on the response. The container can implicitly commit the response if the buffer is full.

Thanks


Going by your words, the following HFSF quote cannot be guaranteed. Isnt it?

When a forward happens, the resource to which the request is forwarded starts with a clear response buffer! In other words, anything written to the response buffer is thrown out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic