What is autoFlush attribute in JSP?


The autoFlush attribute specifies whether the buffered output should be flushed automatically when the buffer is filled, or whether an exception should be raised to indicate the buffer overflow.

A value of true (default) indicates automatic buffer flushing and a value of false throws an exception.

The following directive causes the servlet to throw an exception when the servlet's output buffer is full −

<%@ page autoFlush = "false" %>

This directive causes the servlet to flush the output buffer when full −

<%@ page autoFlush = "true" %>

Usually, the buffer and the autoFlush attributes are coded on a single page directive as follows −

<%@ page buffer = "16kb" autoflush = "true" %>

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 30-Jul-2019

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements