tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Schwörer <j.schwoe...@web.de>
Subject EVAL_BODY_INCLUDE and jasper2
Date Thu, 12 Dec 2002 09:26:36 GMT
hi,

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
generates
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();
  _bc.clear();
  out = _bc;
  _jspx_th_tag_iterate_0.setBodyContent(_bc);
  _jspx_th_tag_iterate_0.doInitBody();
  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
specifies
"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:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message