You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Liu, Xiaoyan" <xl...@CapitalThinking.com> on 2002/09/11 05:32:50 UTC

tomcat 4.1.9 tag pooling and HOW-TO on custom tags?

Hi,

I just tried our custom tags on Tomcat4.1.9 with jdk1.4.
Some iteration kind of tags seem not working properly.
For instance:

 <mytag:loop collection="X">
   <mytag:value object="element" />
 </mytag:loop>

loops on a collection X but always prints out the first
element in the collection. My guess is that 'mytag:value' tag
is being pooled and the same tag instance is used.

So what are the caveats of writing custom tags with tag pooling
in action? My tags do have 'release()' method. What does
'tagPool.reuse()' do exactly?


thanks.


liu

Re: tomcat 4.1.9 tag pooling and HOW-TO on custom tags?

Posted by Peter Lin <tc...@yahoo.com>.
You're going to have to provide more details.  Most
likely the tag isn't compliant. I would suggest trying
a similar test with JSTL first. I've used JSTL core
tags to iterate with tomcat 4.1.10 and they work fine.

the next step it to look at how JSTL handles iteration
and compare it to your custom tag. I'm guessing you
extended javax.servlet.jsp.tagext.IterationTag.

You may want to consider changing it to extend
javax.servlet.jsp.jstl.core.LoopTag, LoopTagStatus or
LoopTagSupport.

most likely the index information isn't being stored
correctly and lost. Therefore it begins at the start
every time.

peter

--- "Liu, Xiaoyan" <xl...@CapitalThinking.com> wrote:
> Hi,
> 
> I just tried our custom tags on Tomcat4.1.9 with
> jdk1.4.
> Some iteration kind of tags seem not working
> properly.
> For instance:
> 
>  <mytag:loop collection="X">
>    <mytag:value object="element" />
>  </mytag:loop>
> 
> loops on a collection X but always prints out the
> first
> element in the collection. My guess is that
> 'mytag:value' tag
> is being pooled and the same tag instance is used.
> 
> So what are the caveats of writing custom tags with
> tag pooling
> in action? My tags do have 'release()' method. What
> does
> 'tagPool.reuse()' do exactly?
> 
> 
> thanks.
> 
> 
> liu
> 


__________________________________________________
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>