• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic