It's not a secret anymore!*
The moose likes JSP and the fly likes Buffer, Buffer! How good a size should you be? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Buffer, Buffer! How good a size should you be?" Watch "Buffer, Buffer! How good a size should you be?" New topic
Author

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

boyet silverio
Ranch Hand

Joined: Aug 28, 2002
Posts: 173
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?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Buffer, Buffer! How good a size should you be?
 
Similar Threads
Flushing the response?
help with code (inputstream)..... ?
What is the use of flush?
How do you link 8k with 12264 ?
Buffer size