> -----Original Message-----
> From: Felipe Schnack [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, February 04, 2003 10:59 AM
> To: Tomcat Users List
> Subject: RE: more about custam tag life cycle
> 
> 
>   because sometimes we have a tag attribute that isn't 
> actually an getter/setter attribute for declaring in TLD 
> file... is just a instance variable that you need, like a 
> counter, or something like it.

Oh...well in that case it's not really a "tag attribute" per se (i.e., not 
container-managed), but what the Jakarta taglib developer guidelines call 
"invocation-specific state."  In those cases, by all means you can release them in 
doFinally. :-)

Although, frequently you can just reset them in doStartTag and not have to incur the 
expense of a try/catch/finally block.  It's only when you're holding onto an expensive 
resource (db connection, file handle, etc.) through the invocation of the tag that it 
makes sense to release it in doFinally.

-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863


> 
> On Tue, 2003-02-04 at 13:44, Tim Moore wrote:
> > > -----Original Message-----
> > > From: Felipe Schnack [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, February 04, 2003 6:20 AM
> > > To: Tomcat Users List
> > > Subject: Re: more about custam tag life cycle
> > > 
> > > 
> > > > > > The way to look at it is simply that the generated code
> > > is going
> > > > > > to use
> > > > a
> > > > > > tag pool for each distinct class of tags.
> > > Unfortunately, there is
> > > > > > no specific action that tells the tag it is being
> > > pulled from or
> > > > > > being put
> > > > back
> > > > > > from the pool.
> > > > > >
> > > > >
> > > > > The page will call release() before it is put back in 
> the pool.
> > > > 
> > > > Totally and completely false.  Please go back and read the
> > > JSP Spec.
> > > > The page will call release() before the tag is released to
> > > GC, and for
> > > > no other reason.
> > >   Now I'm really convinced that I should use doFinally()
> > 
> > I'm personally of the opinion that you should *never* have to clear 
> > your tag attributes for any reason, because you're 
> guaranteed by the 
> > spec that a given tag instance will only be reused for invocations 
> > with the same attribute set.  Each attribute will either be 
> > overwritten or assumed to stay the same, so why do you need to ever 
> > clear them?
> > 
> > --
> > Tim Moore / Blackboard Inc. / Software Engineer
> > 1899 L Street, NW / 5th Floor / Washington, DC 20036
> > Phone 202-463-4860 ext. 258 / Fax 202-463-4863
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> -- 
> 
> Felipe Schnack
> Analista de Sistemas
> [EMAIL PROTECTED]
> Cel.: (51)91287530
> Linux Counter #281893
> 
> Centro Universitário Ritter dos Reis 
> http://www.ritterdosreis.br > [EMAIL PROTECTED]
> 
> Fone/Fax.: (51)32303341
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to