Name

BodyContent Class

Class name:

javax.servlet.jsp.tagext.BodyContent

Extends:

javax.servlet.jsp.JspWriter

Implements:

None

Implemented by:

Internal container-dependent class

Description

The container creates an instance of the BodyContent class to hold the result of evaluating the element’s body content if the corresponding tag handler implements the BodyTag interface. The container makes the BodyContent instance available to the tag handler by calling the setBodyContent() method, so the tag handler can process the body content.

Constructor

protected BodyContent(JspWriter e)

Creates a new instance with the specified JspWriter as the enclosing writer.

Methods

public void clearBody()

Removes all buffered content for this instance.

public void flush() throws java.io.IOException

Overwrites the behavior inherited from JspWriter to always throw an IOException, since it’s invalid to flush a BodyContent instance.

public JspWriter getEnclosingWriter()

Returns the enclosing JspWriter; in other words, either the top-level JspWriter or the JspWriter (BodyContent subclass) of the parent tag handler.

public abstract java.io.Reader getReader()

Returns the value of this BodyContent object as a Reader with the content produced by evaluating the element’s body.

public abstract String getString()

Returns the value of this BodyContent object as a String with the content produced by evaluating the element’s body.

public abstract void writeOut(java.io.Writer out) throws java.io.IOException

Writes the ...

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.