This Section illustrate about the 'buffer' & 'autoFlush' attribute of JSP page directive.
This Section illustrate about the 'buffer' & 'autoFlush' attribute of JSP page directive.This Section illustrate about the 'buffer' & 'autoFlush' attribute of JSP page directive.
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' 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" %> |
EXAMPLE :
<%@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>"); } %> |
Output