|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The BodyTag interface extends Tag by defining additional methods that let a Tag handler access its body.
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()
Field Summary | |
static int |
EVAL_BODY_TAG
Request the creation of new BodyContent on which to evaluate the body of this tag. |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE,
EVAL_PAGE,
SKIP_BODY,
SKIP_PAGE |
Method Summary | |
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. |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
doEndTag,
doStartTag,
getParent,
release,
setPageContext,
setParent |
Field Detail |
public static final int EVAL_BODY_TAG
Method Detail |
public void setBodyContent(BodyContent b)
This method will not be invoked if there is no body evaluation.
b
- the BodyContentpublic void doInitBody() throws JspError
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.
public int doAfterBody() throws JspError
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |