• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The order of doEndTag, popBody

 
Patrick Chen
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems everybody agrees pusBody happens after doStartTag().
However, for doEndTag,popBody , I see different opinions.
Anybody there can help me?
Thanks!
P.Chen
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The pageContext.popBody() is called before the doEndTag() method is called, and only when there are no more evaluations of doAfterBody().
Simon
 
Hafizur Rahman
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a descriptive one, you can hit
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags7.html#68637
----------
Hafizur Rahman
SCJP
 
k space
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agreed with Simon that the popBody is called before doEndTag.
JSP.10.1.2.4 Methods
public int doAfterBody()
. . .
If doAfterBody returns EVAL_BODY_AGAIN, a new evaluation of the body will happen (followed by another invocation of doAfterBody).
If doAfterBody returns SKIP_BODY no more body evaluations will occur, the value of out will be restored using the popBody method in pageContext, and then doEndTag will be invoked.
. . .
 
Timber Lee
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
* is pageContext.popBody() called by doEndTag() method?
* what to call pageContext.pushBody()?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic