Name

out

Variable name:

out

Class name:

javax.servlet.jsp.JspWriter

Extends:

java.io.Writer

Implements:

None

Implemented by:

A concrete subclass of this abstract class is provided as an internal container-dependent class.

JSP page type:

Available in both regular JSP pages and error pages

Description

The out variable is assigned to a concrete subclass of the JspWriter abstract class by the web container. JspWriter emulates some of the functionality found in the java.io.BufferedWriter and java.io.PrintWriter classes. It differs, however, in that it throws a java.io.IOException from the print methods (the PrintWriter does not).

If the page directive attribute autoflush is set to true, all the I/O operations on this class automatically flush the contents of the buffer when it’s full. If autoflush is set to false, all the I/O operations on this class throw an IOException when the buffer is full.

Constructor

protected JspWriter(int bufferSize, boolean autoFlush)

Creates an instance with at least the specified buffer size and autoflush behavior.

Methods

public abstract void clear() throws java.io.IOException

Clears the contents of the buffer. If the buffer has already been flushed, throws an IOException to signal the fact that some data has already been irrevocably written to the client response stream.

public abstract void clearBuffer() throws java.io.IOException

Clears the current contents of the buffer. Unlike clear(), this method does not throw an IOException if the buffer has already been ...

Get JavaServer Pages Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.