Although this doesn't address the problem you're having with your tag, you
should consider using the Struts tag library. The Iteration Tag in the logic
tags does exactly what you want and it's been tested extensively.
http://jakarta.apache.org/struts/doc-1.0.2/struts-logic.html#iterate
Hamish

-----Original Message-----
From: Albert Pastrana [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 6:25 PM
To: tomcat-list
Subject: Tomcat 4.0 and IterationTag


Hi,

I've a tomcat 4.0 (downloaded latest week) in a Win2k pro.

I've a little problem running it as service, but running stand-alone
everything it's right.

The first problem comes when creating an iteration tag. I've followed many
explanations and, of course, read all the javadocs, and I cannot understand
what I'm doing wrong.

My code is something like that:

public class RepeatTag
extends      TagSupport
{
   int num = 0;

   boolean endLoop()   { return num==10; }
   void    nextElement() { num++;  }

   public int doStartTag() throws JspException {
      if (!endLoop()) {
         nextElement();
         return EVAL_BODY_AGAIN;
     }
     return SKIP_BODY;
   }

   public int doAfterBody() throws JspException {
      if (!endLoop()) {
         nextElement();
         return EVAL_BODY_AGAIN;
      } else {
         return SKIP_BODY;
      }
  }

} //end class RepeatTag

And the problem is that my Tomcat is saying me that exception:
"javax.servlet.ServletException: Since tag handler class
com.ludicus.general.taglib.RepeatTag does not implement BodyTag, it can't
return BodyTag.EVAL_BODY_TAG"

I've read a lot of documentation about JSP1.2 and I think that's the right
solution, but I supose I'm doing something wrong, could anyone tell me
what's the problem?

thanks a lot

  albert


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to