• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Buffer, Buffer! How good a size should you be?

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't really fully understand how the 'buffer' value is best set when used in jsp pages. What are factors to consider in changing the default buffer size? I noticed that buffer='none' is even an option. When is this used? Thanks in advance for any comments?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The default value is 8k.
In most cases that I've seen people wanting to alter this value, it has been better to redesign the page rather than try to decide on a new value.
The main use of the Buffer is to allow you to output data to the client and then change your mind. A better decision would be to decide what you want to output before you start sending it.
It also comes in handy when an exception is thrown while a page is being sent. In this case, if the buffer hasn't filled yet, it is cleared and the user is sent to the error page. If the response has already been comitted because the Buffer has been sent, the error page may or may not be sent as well. It shouldn't be sent, but some servers do still send it. In this case it would again be preferable to protect against exceptions rather than making the buffer larger to handle this condition.
Hope this helps.
Dave
 
reply
    Bookmark Topic Watch Topic
  • New Topic