On Sat, 5 Feb 2000, Kevin Jones wrote:

> Yes - I know it's for looping but that still doesn't explai the point - I
> could just as easily do this
>
> public int soAfterBody()
> {
>         while(bNotDone)
>         {
>         }
>         return SKIP_BODY
> }
>
> I don't need EVAL_BODY_TAG to let me loop!!!!
>
> Kevin Jones
> DevelopMentor

I guess it depends on what you want to loop.  If you just want to loop
java code that's part of your tag implementation, you're right, you can do
it the way you describe.  If you want to loop what's in the body of your
tag (what the JSP page author has written between your start and end
tags--which could include other tags) you must use EVAL_BODY_TAG.

> > -----Original Message-----
> > From: A mailing list about Java Server Pages specification and reference
> > [mailto:[EMAIL PROTECTED]]On Behalf Of John K. Peterson
> > Sent: 04 February 2000 20:39
> > To: [EMAIL PROTECTED]
> > Subject: Re: Point of EVAL_BODY_TAG
> >
> >
> > 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
>
> ===========================================================================
> 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
>

John K Peterson -- IT Services Systems Engineering -- Brigham Young University
[EMAIL PROTECTED]

===========================================================================
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