Yes, I thought the same, because I did a similar tag some months ago, but I
looked at the JSP1.2 specification and docs and I saw that now, TagSupport
is implementing IterationTag (a new interface) and that the right way (the
other will be deprecated) to do an iteration tag is extending TagSupport.

thanks

----- Original Message ----- 
From: "Rich Sneiderman" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Monday, March 18, 2002 6:30 PM
Subject: RE: Tomcat 4.0 and IterationTag


> I haven't implemented on of these yet but it sounds like you should be
> inheriting from BodyTagSupport not TagSupport.
> 
> - Rich
> 
> -----Original Message-----
> From: Albert Pastrana [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, March 18, 2002 9:25 AM
> 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]>

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

Reply via email to