Share on Google+Share on Google+

The 'buffer' and 'autoFlush' Attribute of JSP page directive

This Section illustrate about the 'buffer' & 'autoFlush' attribute of JSP page directive.

The 'buffer' and 'autoFlush' Attribute of  JSP page directive

This Section illustrate about the 'buffer' & 'autoFlush' attribute of JSP page directive.

The 'buffer' attribute

The out object  uses buffer to handle output generated by the JSP page on the client web browser. The 'buffer' attribute sets the buffer size in kilobyte .If you specify a buffer size, the output is buffered with at least the size you specified. The default value is 8kb.

The 'autoFlush' attribute

The 'autoFlush' is a Boolean attribute, used for flushing buffer automatically when the buffer is full. If the 'autoFlush' set to 'true', the buffer will be flushed automatically otherwise it will generate a raised exception ,if you set the false value. You cannot set the false value if the buffer size is none. If you specify the buffer size except "none" ,then the output will be buffered with at least 8kb because the default and minimum value of the buffer attribute is 8kb.

Syntax :

<%@page buffer="SIZE in kb" autoFlush="true / false" %>


<%@page buffer="5kb" autoFlush="false" %>


for(int i = 0; i < 4; i++){

out.println("<html><body><img src=E:/ankit/ankit_jdbc/Child.jpg ></body></html>");




Download Source Code



Posted on: June 12, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null