Package javax.servlet.jsp.tagext
Class BodyTagSupport
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- javax.servlet.jsp.tagext.BodyTagSupport
-
public class BodyTagSupport extends TagSupport implements BodyTag
Actions in a Tag Library are defined through subclasses of Tag.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BodyContentbodyContent-
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
Constructors 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdoAfterBody()Actions after some body has been evaluated.intdoEndTag()Process the end tag.voiddoInitBody()Prepare for evaluation of the body It will be invoked at most once per action invocation.intdoStartTag()Process the start tag for this instance.BodyContentgetBodyContent()Get current bodyContentJspWritergetPreviousOut()Get surrounding outvoidrelease()reset the state of the TagvoidsetBodyContent(BodyContent b)Prepare for evaluation of the body It will be invoked at most once per action invocation.-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
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
getParent, setPageContext, setParent
-
-
-
-
Field Detail
-
bodyContent
protected BodyContent bodyContent
-
-
Method Detail
-
doStartTag
public int doStartTag() throws JspExceptionProcess the start tag for this instance. The doStartTag() method assumes that all setter methods have been invoked before. When this method is invoked, the body has not yet been invoked.- Specified by:
doStartTagin interfaceTag- Overrides:
doStartTagin classTagSupport- Throws:
JspException- See Also:
BodyTag
-
doEndTag
public int doEndTag() throws JspExceptionProcess the end tag. This method will be called on all Tag objects. All instance state associated with this instance must be reset. The release() method should be called after this invocation.- Specified by:
doEndTagin interfaceTag- Overrides:
doEndTagin classTagSupport- Throws:
JspException
-
setBodyContent
public void setBodyContent(BodyContent b)
Prepare for evaluation of the body It will be invoked at most once per action invocation. Will not be invoked if there is no body evaluation. Frequently it is not redefined by Tag author.- Specified by:
setBodyContentin interfaceBodyTag- Parameters:
b- the BodyContent
-
doInitBody
public void doInitBody() throws JspExceptionPrepare for evaluation of the body It will be invoked at most once per action invocation. Will not be invoked if there is no body evaluation. Frequently it is not redefined by Tag author.- Specified by:
doInitBodyin interfaceBodyTag- Throws:
JspException
-
doAfterBody
public int doAfterBody() throws JspExceptionActions after some body has been evaluated. Not invoked in empty tags or in tags returning SKIP_BODY in doStartTag() This method is invoked after every body evaluation. The pair "BODY -- doAfterBody()" is invoked initially if doStartTag() returned EVAL_BODY_TAG, and it is repeated as long as the doAfterBody() evaluation returns EVAL_BODY_TAGThe method re-invocations may be lead to different actions because there might have been some changes to shared state, or because of external computation.
- Specified by:
doAfterBodyin interfaceBodyTag- Throws:
JspException
-
release
public void release()
reset the state of the Tag- Specified by:
releasein interfaceTag- Overrides:
releasein classTagSupport
-
getBodyContent
public BodyContent getBodyContent()
Get current bodyContent
-
getPreviousOut
public JspWriter getPreviousOut()
Get surrounding out
-
-