tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Schwörer <>
Subject repost: eval_body_include and jasper2
Date Sat, 14 Dec 2002 07:38:04 GMT

i have a question concering the difference between EVAL_BODY_BUFFERED and EVAL_BODY_INCLUDE.
if i understand correctly, the only difference is that EVAL_BODY_BUFFERED buffers the output
so that it
can be evaluated in doEndTag().

when i have a custom tag which extends BodyTagSupport (and so implements IterationTag) jasper2
the following code:

int _jspx_eval_tag_iterate_0 = _jspx_th_tag_iterate_0.doStartTag();
if (_jspx_eval_tag_iterate_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
Cms mycms = null;
if (_jspx_eval_tag_iterate_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
  javax.servlet.jsp.tagext.BodyContent _bc = pageContext.pushBody();
  out = _bc;
  mycms = (Cms) pageContext.findAttribute("mycms");
do {

if my custom tag now returns EVAL_BODY_INCLUDE from doStartTag() the
variable "mycms" is only initialized at the end of the do { } while loop. the TagExtraInfo
"mycms" as VariableInfo.NESTED which means to me that between doStartTag() and doEndTag()
my variable
must be properly initialized.
why do i have to return EVAL_BODY_BUFFERED and not EVAL_BODY_INCLUDE from doStartTag() to
make my tag work?
this was not necessary in jasper1.

can someone please clarify the behaviour?

thanks in advance

jochen schwoerer

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message