• Post Reply Bookmark Topic Watch Topic
  • New Topic

"jsp:include" : why use "flush=true" ?

 
Sol Mayer-Orn
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When using "jsp:include", tutorials often recommend flushing:
<jsp:include page="myPage.jsp" flush="true" />
The documentation says this would flush the response buffer before starting to write the included page.

But *why* is this important ?
If you don't flush, isn't it true that the included page will keep writing into the current buffer, and flush it when it's full ? What's wrong with that ? That even sounds more efficient....

Thanks
 
Tom E. Cole
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, however there is a buffer size that you don't want to go beyond before sending data. There are times where you will exceed this buffer before a flush and your content will stop being sent. The two options are to flush or increase the buffer size (which I believe defaults at 8KB).

The downside to flushing is at that point the response is comitted and cannot be forwarded.
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are times where you will exceed this buffer before a flush and your content will stop being sent.

If the buffer is exceeded, isn't it flushed automatically?

-Yuriy
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!