public interface BodyTag extends Tag
The interface provides two new methods: one is to be invoked with the BodyContent for the evaluation of the body, the other is to be reevaluated after every body evaluation.
Without repeating the portions described in Tag.java, a typical invocation sequence is:
-- we are picking up after all the setters have been done
t.doStartTag();
out = pageContext.pushBody();
-- prepare for body
t.setBodyContent(out);
-- preamble
t.doBodyInit();
-- BODY evaluation into out
t.doAfterBody();
-- while doAfterBody returns EVAL_BODY_TAG we iterate
-- BODY evaluation into out
t.doAfterBody()
-- done
t.doEndTag()
Modifier and Type | Field and Description |
---|---|
static int |
EVAL_BODY_TAG
Request the creation of new BodyContent on which to evaluate the
body of this tag.
|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Modifier and Type | Method and Description |
---|---|
int |
doAfterBody()
Actions after some body has been evaluated.
|
void |
doInitBody()
Prepare for evaluation of the body.
|
void |
setBodyContent(BodyContent b)
Setter method for the bodyContent property.
|
doEndTag, doStartTag, getParent, release, setPageContext, setParent
static final int EVAL_BODY_TAG
void setBodyContent(BodyContent b)
This method will not be invoked if there is no body evaluation.
b
- the BodyContentvoid doInitBody() throws JspException
The method will be invoked once per action invocation by the page implementation after a new BodyContent has been obtained and set on the tag handler via the setBodyContent() method and before the evaluation of the tag's body into that BodyContent.
This method will not be invoked if there is no body evaluation.
JspException
int doAfterBody() throws JspException
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_TAG
The method re-invocations may be lead to different actions because there might have been some changes to shared state, or because of external computation.
JspException
Copyright © 1999-2000 The Apache Software Foundation. All Rights Reserved.