javax.servlet.jsp.tagext

Class BodyTagSupport

public class BodyTagSupport extends TagSupport implements BodyTag

A base class for defining tag handlers implementing BodyTag.

The BodyTagSupport class implements the BodyTag interface and adds additional convenience methods including getter methods for the bodyContent property and methods to get at the previous out JspWriter.

Many tag handlers will extend BodyTagSupport and only redefine a few methods.

Field Summary
protected BodyContentbodyContent
The current BodyContent for this BodyTag.
Constructor Summary
BodyTagSupport()
Default constructor, all subclasses are required to only define a public constructor with the same signature, and to call the superclass constructor.
Method Summary
intdoAfterBody()
After the body evaluation: do not reevaluate and continue with the page.
intdoEndTag()
Default processing of the end tag returning EVAL_PAGE.
voiddoInitBody()
Prepare for evaluation of the body just before the first body evaluation: no action.
intdoStartTag()
Default processing of the start tag returning EVAL_BODY_BUFFERED.
BodyContentgetBodyContent()
Get current bodyContent.
JspWritergetPreviousOut()
Get surrounding out JspWriter.
voidrelease()
Release state.
voidsetBodyContent(BodyContent b)
Prepare for evaluation of the body: stash the bodyContent away.

Field Detail

bodyContent

protected BodyContent bodyContent
The current BodyContent for this BodyTag.

Constructor Detail

BodyTagSupport

public BodyTagSupport()
Default constructor, all subclasses are required to only define a public constructor with the same signature, and to call the superclass constructor. This constructor is called by the code generated by the JSP translator.

Method Detail

doAfterBody

public int doAfterBody()
After the body evaluation: do not reevaluate and continue with the page. By default nothing is done with the bodyContent data (if any).

Returns: SKIP_BODY

Throws: JspException if an error occurred while processing this tag

See Also: BodyTagSupport BodyTag

doEndTag

public int doEndTag()
Default processing of the end tag returning EVAL_PAGE.

Returns: EVAL_PAGE

Throws: JspException if an error occurred while processing this tag

See Also: Tag

doInitBody

public void doInitBody()
Prepare for evaluation of the body just before the first body evaluation: no action.

Throws: JspException if an error occurred while processing this tag

See Also: BodyTagSupport BodyTagSupport BodyTag

doStartTag

public int doStartTag()
Default processing of the start tag returning EVAL_BODY_BUFFERED.

Returns: EVAL_BODY_BUFFERED

Throws: JspException if an error occurred while processing this tag

See Also: BodyTag

getBodyContent

public BodyContent getBodyContent()
Get current bodyContent.

Returns: the body content.

getPreviousOut

public JspWriter getPreviousOut()
Get surrounding out JspWriter.

Returns: the enclosing JspWriter, from the bodyContent.

release

public void release()
Release state.

See Also: Tag

setBodyContent

public void setBodyContent(BodyContent b)
Prepare for evaluation of the body: stash the bodyContent away.

Parameters: b the BodyContent

See Also: BodyTagSupport doInitBody BodyTag

Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.