tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Hartung" <wi...@msoft.com>
Subject Re: more about custam tag life cycle
Date Mon, 03 Feb 2003 20:13:02 GMT
> From: "Felipe Schnack" <felipes@ritterdosreis.br>
> Sent: Monday, February 03, 2003 11:11 AM
> Subject: Re: more about custam tag life cycle


>  I'm curious, how you get a PageContext when the container doesn't call
> setPageContext? Which container have this behavior?
>   I don't see a reason why we should have pool-specific method for tag
> property cleaning. doFinally method is intended for tag cleaning...
> Probably when created it was intended for cleaning resources like
> database connections, etc but I don't see any reason to create yet
> another method just for tag reuse

No, the issue was that in some containers, setPageContext was called for
each Tag invocation. So, for some containers you'd get from this code:
<tags:mytag prop1="prop"/>
<tags:mytag prop1="prop2"/>

this:

Tag t = getOrCreateTagFromPool();
t.setPageContext(...)
t.setProperties(...)
t.doStartTag()
t.doEndTag()
sendTagToPool(t)
t = getOrCreateTagFromPool();
t.setPageContext(...)
t.setProperties(...)
etc.

Give the behviour of a tag always have setPageContext called, leads to the
assumption that's it's good point to place "restarting the tag" code.

However, other containers will call setPageContext only once, at the first
invocation, rather than everytime a tag is used. It was either Resin or JRun
as I recall.

It makes sense, why call setPageContext repeatedly as ideally it doesn't
change. It was just something I saw when I was first dealing with this
issue, I tried it out, and boom, there goes that ASS-U-ME thing when I tried
it on a different container.

Regards,

Will Hartung
(willh@msoft.com)




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message