On Fri, 4 Feb 2000, Kevin Jones wrote:

> what is the point of returning EVAL_BODY_TAG from doAfterBody.
>
> The only use I can see is if the doAfterBody produces or amends some JSP and
> wants the JSP re-evaluated. Is this the only/main use or am I missing
> something?

Ahh.  I didn't understand this for a long time either--It's really
misnamed, IMHO.  Basically, it's for looping.  In the produced code, it
looks something like this:

doInitBody();
do {
  // stuff within body
} while (doAfterBody == EVAL_BODY_TAG);

So, after each iteration, doAfterBody decides whether to go again.  For a
simple loop, doInitBody might set a variable to 1 and then doAfterBody
would increment it and return SKIP_BODY when it reached a certain value.

I wish the docs would give and example like this--I had to read the
produced code to understand it.

John K Peterson  --  IT Services Development  --  Brigham Young University
Internet: [EMAIL PROTECTED]                      Phone: (801) 378-5007

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to