Package jakarta.servlet.jsp.tagext
Class BodyTagSupport
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
jakarta.servlet.jsp.tagext.BodyTagSupport
- All Implemented Interfaces:
- BodyTag,- IterationTag,- JspTag,- Tag,- Serializable
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:
- 
Field SummaryFieldsFields inherited from class jakarta.servlet.jsp.tagext.TagSupportid, pageContextFields inherited from interface jakarta.servlet.jsp.tagext.BodyTagEVAL_BODY_BUFFERED, EVAL_BODY_TAGFields inherited from interface jakarta.servlet.jsp.tagext.IterationTagEVAL_BODY_AGAINFields inherited from interface jakarta.servlet.jsp.tagext.TagEVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor, all subclasses are required to only define a public constructor with the same signature, and to call the superclass constructor.
- 
Method SummaryModifier and TypeMethodDescriptionintAfter the body evaluation: do not reevaluate and continue with the page.intdoEndTag()Default processing of the end tag returning EVAL_PAGE.voidPrepare for evaluation of the body just before the first body evaluation: no action.intDefault processing of the start tag returning EVAL_BODY_BUFFERED.Get current bodyContent.Get surrounding out JspWriter.voidrelease()Release state.voidPrepare for evaluation of the body: stash the bodyContent away.Methods inherited from class jakarta.servlet.jsp.tagext.TagSupportfindAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValueMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.jsp.tagext.TaggetParent, setPageContext, setParent
- 
Field Details- 
bodyContentThe current BodyContent for this BodyTag.
 
- 
- 
Constructor Details- 
BodyTagSupportpublic 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 Details- 
doStartTagDefault 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:
 
- 
doEndTagDefault 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:
 
- 
setBodyContentPrepare for evaluation of the body: stash the bodyContent away.- Specified by:
- setBodyContentin interface- BodyTag
- Parameters:
- b- the BodyContent
- See Also:
 
- 
doInitBodyPrepare 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:
 
- 
doAfterBodyAfter 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:
 
- 
releasepublic void release()Release state.- Specified by:
- releasein interface- Tag
- Overrides:
- releasein class- TagSupport
- See Also:
 
- 
getBodyContentGet current bodyContent.- Returns:
- the body content.
 
- 
getPreviousOutGet surrounding out JspWriter.- Returns:
- the enclosing JspWriter, from the bodyContent.
 
 
-