public class BodyTagSupport extends TagSupport implements 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.
Modifier and Type | Field and Description |
---|---|
protected BodyContent |
bodyContent
The current BodyContent for this BodyTag.
|
id, pageContext
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
EVAL_BODY_AGAIN
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor and Description |
---|
BodyTagSupport()
Default constructor, all subclasses are required to only define
a public constructor with the same signature, and to call the
superclass constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
doAfterBody()
After the body evaluation: do not reevaluate and continue with the page.
|
int |
doEndTag()
Default processing of the end tag returning EVAL_PAGE.
|
void |
doInitBody()
Prepare for evaluation of the body just before the first body evaluation:
no action.
|
int |
doStartTag()
Default processing of the start tag returning EVAL_BODY_BUFFERED.
|
BodyContent |
getBodyContent()
Get current bodyContent.
|
JspWriter |
getPreviousOut()
Get surrounding out JspWriter.
|
void |
release()
Release state.
|
void |
setBodyContent(BodyContent b)
Prepare for evaluation of the body: stash the bodyContent away.
|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParent, setPageContext, setParent
protected BodyContent bodyContent
public BodyTagSupport()
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class TagSupport
JspException
- if an error occurred while processing this tagTag.doStartTag()
public int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class TagSupport
JspException
- if an error occurred while processing this tagTag.doEndTag()
public void setBodyContent(BodyContent b)
setBodyContent
in interface BodyTag
b
- the BodyContentdoAfterBody()
,
doInitBody()
,
BodyTag.setBodyContent(javax.servlet.jsp.tagext.BodyContent)
public void doInitBody() throws JspException
doInitBody
in interface BodyTag
JspException
- if an error occurred while processing this tagsetBodyContent(javax.servlet.jsp.tagext.BodyContent)
,
doAfterBody()
,
BodyTag.doInitBody()
public int doAfterBody() throws JspException
doAfterBody
in interface IterationTag
doAfterBody
in class TagSupport
JspException
- if an error occurred while processing this tagdoInitBody()
,
IterationTag.doAfterBody()
public void release()
release
in interface Tag
release
in class TagSupport
Tag.release()
public BodyContent getBodyContent()
public JspWriter getPreviousOut()
Copyright © 2018 JBoss by Red Hat. All rights reserved.