Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.servlet.jsp.tagext
Class BodyTagSupport

    java.lang.Object
      |
      +--javax.servlet.jsp.tagext.TagSupport
            |
            +--javax.servlet.jsp.tagext.BodyTagSupport

All Implemented Interfaces:
  BodyTag, java.io.Serializable, Tag

public class BodyTagSupport
extends TagSupport
implements BodyTag

Convenience class defining default behavior for a BodyTag. Most implementations will extend BodyTagSupport instead of implementing BodyTag directly.

The default behavior executes the body once, ignoring the contents.

See Also:
  Serialized Form

Field Summary
`protected BodyContent` | `bodyContent`

Fields inherited from class javax.servlet.jsp.tagext.TagSupport
`id, pageContext`

Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
`EVAL_BODY_TAG`

Fields inherited from interface javax.servlet.jsp.tagext.Tag
`EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE`

Constructor Summary
`BodyTagSupport()` Implementing tags must implement a zero-arg constructor.

Method Summary
`int` | `doAfterBody()` Action after the body completes, returning EVAL_BODY_TAG to loop and SKIP_BODY to stop looping.
`void` | `doInitBody()` The default init action is to do nothing.
`int` | `doStartTag()` The default start action is EVAL_BODY_TAG, i.e.
`BodyContent` | `getBodyContent()` Returns the tag's body content.
`JspWriter` | `getPreviousOut()` Returns the enclosing writer.
`void` | `release()` Release the tag.
`void` | `setBodyContent(BodyContent bodyContent)` Called by the JSP engine just before calling doInitBody().

Methods inherited from class javax.servlet.jsp.tagext.TagSupport
`doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface javax.servlet.jsp.tagext.Tag
`doEndTag, getParent, setPageContext, setParent`

Field Detail

### bodyContent

    protected BodyContent bodyContent

Constructor Detail

### BodyTagSupport

    public BodyTagSupport()

  Implementing tags must implement a zero-arg constructor.

Method Detail

### setBodyContent

    public void setBodyContent(BodyContent bodyContent)

  Called by the JSP engine just before calling doInitBody(). Empty tags never have setBodyContent called on them. Because the JSP engine reuses BodyContents, a tag cannot use the body content after doAfterBody completes.
  Specified by:
    `setBodyContent` in interface `BodyTag`
  Parameters:
    `bodyContent` - a bodyContent generated by the JSP engine.

### getBodyContent

    public BodyContent getBodyContent()

  Returns the tag's body content. The body content is in scope for the BodyTag methods doInitBody and doAfterBody, but not for the tag methods doStartTag and doEndTag.

### getPreviousOut

    public JspWriter getPreviousOut()

  Returns the enclosing writer. For BodyTags with no body, this is equivalent to pageContext.getOut().

### doStartTag

    public int doStartTag()
                   throws JspException

  The default start action is EVAL_BODY_TAG, i.e. evaluate the body.
  Specified by:
    `doStartTag` in interface `Tag`
  Overrides:
    `doStartTag` in class `TagSupport`
  Following copied from interface: `javax.servlet.jsp.tagext.Tag`
  Returns:
    SKIP_BODY to ignore the body and EVAL_BODY_INCLUDE to evaluate the body.

### doInitBody

    public void doInitBody()
                    throws JspException

  The default init action is to do nothing.
  Specified by:
    `doInitBody` in interface `BodyTag`

### doAfterBody

    public int doAfterBody()
                    throws JspException

  Action after the body completes, returning EVAL_BODY_TAG to loop and SKIP_BODY to stop looping.

  The default action is to only execute the body once.

  Specified by:
    `doAfterBody` in interface `BodyTag`
  Following copied from interface: `javax.servlet.jsp.tagext.BodyTag`
  Returns:
    EVAL_PAGE to repeat the tag and SKIP_PAGE to stop.

### release

    public void release()

  Release the tag.
  Specified by:
    `release` in interface `Tag`
  Overrides:
    `release` in class `TagSupport`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD