The autoFlush Attribute of page Directive In JSP
This section illustrates you about the autoFlush attribute of the page directive in JSP. This is an boolean attribute. This attribute of the page directive supports for flushing buffer automatically when the buffer is full. The value of the autoFlush attribute is either true or false. If you will specify the true value then the buffer will be flushed 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.
In this section, you will see about the syntaxes of the attribute of the page directive in JSP. In the following JSP code line 1: <%@page buffer="5kb" autoFlush="false" %> is specified for determining the buffer size and permit flushing buffer automatically or not. Hence, the value of the attribute autoFlush is false. So, the page will not be flushed automatically and the output is buffered with at least 8kb size of buffer if you specify the buffer size except none.
Here is the JSP code:
<%@page buffer="5kb" autoFlush="false" %> <% for(int i = 0; i < 10; i++){ out.println("<html><body><img src=images/ marijuana_leaf.jpg /></body></html>"); } %> |
Output of the JSP program: