File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

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

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.
I agree. Here's the link:
subject: Buffer, Buffer! How good a size should you be?
It's not a secret anymore!