Package javax.servlet.jsp.tagext
Class BodyTagSupport
- java.lang.Object
- 
- javax.servlet.jsp.tagext.TagSupport
- 
- javax.servlet.jsp.tagext.BodyTagSupport
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- BodyTag,- IterationTag,- JspTag,- Tag
 
 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. - See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected BodyContentbodyContentThe current BodyContent for this BodyTag.- 
Fields inherited from class javax.servlet.jsp.tagext.TagSupportid, pageContext
 - 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTagEVAL_BODY_BUFFERED, EVAL_BODY_TAG
 - 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTagEVAL_BODY_AGAIN
 - 
Fields inherited from interface javax.servlet.jsp.tagext.TagEVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
- 
 - 
Constructor SummaryConstructors Constructor Description BodyTagSupport()Default constructor, all subclasses are required to only define a public constructor with the same signature, and to call the superclass constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.- 
Methods inherited from class javax.servlet.jsp.tagext.TagSupportfindAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface javax.servlet.jsp.tagext.TaggetParent, setPageContext, setParent
 
- 
 
- 
- 
- 
Field Detail- 
bodyContentprotected transient BodyContent bodyContent The current BodyContent for this BodyTag.
 
- 
 - 
Method Detail- 
doStartTagpublic int doStartTag() throws JspExceptionDefault processing of the start tag returning EVAL_BODY_BUFFERED.- Specified by:
- doStartTagin interface- Tag
- Overrides:
- doStartTagin class- TagSupport
- Returns:
- EVAL_BODY_BUFFERED
- Throws:
- JspException- if an error occurred while processing this tag
- See Also:
- Tag.doStartTag()
 
 - 
doEndTagpublic int doEndTag() throws JspExceptionDefault processing of the end tag returning EVAL_PAGE.- Specified by:
- doEndTagin interface- Tag
- Overrides:
- doEndTagin class- TagSupport
- Returns:
- EVAL_PAGE
- Throws:
- JspException- if an error occurred while processing this tag
- See Also:
- Tag.doEndTag()
 
 - 
setBodyContentpublic void setBodyContent(BodyContent b) Prepare for evaluation of the body: stash the bodyContent away.- Specified by:
- setBodyContentin interface- BodyTag
- Parameters:
- b- the BodyContent
- See Also:
- doAfterBody(),- doInitBody(),- BodyTag.setBodyContent(javax.servlet.jsp.tagext.BodyContent)
 
 - 
doInitBodypublic void doInitBody() throws JspExceptionPrepare for evaluation of the body just before the first body evaluation: no action.- Specified by:
- doInitBodyin interface- BodyTag
- Throws:
- JspException- if an error occurred while processing this tag
- See Also:
- setBodyContent(javax.servlet.jsp.tagext.BodyContent),- doAfterBody(),- BodyTag.doInitBody()
 
 - 
doAfterBodypublic int doAfterBody() throws JspExceptionAfter the body evaluation: do not reevaluate and continue with the page. By default nothing is done with the bodyContent data (if any).- Specified by:
- doAfterBodyin interface- IterationTag
- Overrides:
- doAfterBodyin class- TagSupport
- Returns:
- SKIP_BODY
- Throws:
- JspException- if an error occurred while processing this tag
- See Also:
- doInitBody(),- IterationTag.doAfterBody()
 
 - 
releasepublic void release() Release state.- Specified by:
- releasein interface- Tag
- Overrides:
- releasein class- TagSupport
- See Also:
- Tag.release()
 
 - 
getBodyContentpublic BodyContent getBodyContent() Get current bodyContent.- Returns:
- the body content.
 
 - 
getPreviousOutpublic JspWriter getPreviousOut() Get surrounding out JspWriter.- Returns:
- the enclosing JspWriter, from the bodyContent.
 
 
- 
 
-