You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Heath Borders <he...@gmail.com> on 2005/02/15 17:20:25 UTC

release method not called in MyFaces Tags

I noticed that the only play the release method is called is inside of
UIComponentTag, and not in any of its children.  I don't really know
much about JSP tag development, but I was under the impression that
release should clear all a Tag's instance variables in preparation for
another use.  Is this not this case?  Can I get rid of a lot of
release calls?

-- 
-Heath Borders-Wing
hborders@mail.win.org

Re: release method not called in MyFaces Tags

Posted by Heath Borders <he...@gmail.com>.
It wasn't just in custom components.  The UIMessages tag and
UIComponentTagBase don't do it either.  That was how I came across it,
but I'll bet its fairly rampant.


On Wed, 16 Feb 2005 11:49:57 +0100, Matthias Wessendorf
<ma...@matthias-wessendorf.de> wrote:
> Hi Heath-
> 
> I just looked into some of our custom components
> there are also some without calling release();
> 
> Well indeed it should be called in each component
> tag, as far as I see it.
> 
> BTW. there was once an issue on a topic related
> to this (see http://tinyurl.com/5hp77).
> 
> Perhaps Daniel could point it out?
> 
> Regards!
> 
> -Matthias
> 
> 
> Heath Borders wrote:
> > I noticed that the only play the release method is called is inside of
> > UIComponentTag, and not in any of its children.  I don't really know
> > much about JSP tag development, but I was under the impression that
> > release should clear all a Tag's instance variables in preparation for
> > another use.  Is this not this case?  Can I get rid of a lot of
> > release calls?
> >
> 
> --
> Matthias Weßendorf
> Aechterhoek 18
> DE-48282 Emsdetten
> Germany
> phone: +49-2572-9170275
> cell phone: +49-179-1118979
> email: matzew AT apache DOT org
> url: http://www.wessendorf.net
> callto://mwessendorf (Skype)
> icq: 47016183
> 


-- 
-Heath Borders-Wing
hborders@mail.win.org

Re: release method not called in MyFaces Tags

Posted by Heath Borders <he...@gmail.com>.
I was just looking in the share packages.


On Fri, 18 Feb 2005 15:38:45 +0100, Matthias Wessendorf
<ma...@matthias-wessendorf.de> wrote:
> Ok Heath,
> 
> I just looked at this hierarchy:
> 
> http://incubator.apache.org/myfaces/javadoc/org/apache/myfaces/taglib/html/ext/HtmlSelectOneRadioTag.html
> 
> only "javax.faces.webapp.UIComponentTag"
> contains a "release()"
> 
> So I'll add to *each* Tag clazz I see a method like:
> 
> public void release(){
>   super.release()
> 
>   newIntroducedProperty1 = null;
>   ... = null;
> }
> 
> (e.g. for HtmlSelectOneRadioTag.java I'll set _enabledOnUserRole and
> _visibleOnUserRole both to null)
> 
> I started looking at custom tags
> and I am still looking a *share* packages.
> 
> Which packages did you see?
> 
> Thanks for pointing it out!
> 
> -Matthias
> 
> 
> Matthias Wessendorf wrote:
> > Hi Heath,
> >
> > yes, I think also!
> >
> > So I will look on some tag clazzes during this day.
> >
> > -Matthias
> >
> > Heath Borders wrote:
> >
> >> I understand that, but shouldn't it be considered best practice to
> >> have the release method release all resources not needed?  Thus, it
> >> would need to be implemented on ever UIComponentTag
> >>
> >>
> >> On Wed, 16 Feb 2005 08:48:35 -0300, Daniel Kamakura
> >> <da...@gmail.com> wrote:
> >>
> >>> Hi all,
> >>> The release() method can be used to clean Tag state, to release any
> >>> resources that the Tag was using. Notice that it is up to the
> >>> Container to call the release() method when seemed fit, so you can't
> >>> rely on this method being called at any specific time. In theory, this
> >>> method could be called 12 days after the Tag was used. For this
> >>> reason, any code that must be executed at the end of the Tag usage
> >>> should be called from the doEndTag() method.
> >>>
> >>> Regards,
> >>> Daniel Kamakura
> >>>
> >>> On Wed, 16 Feb 2005 11:49:57 +0100, Matthias Wessendorf
> >>> <ma...@matthias-wessendorf.de> wrote:
> >>>
> >>>> Hi Heath-
> >>>>
> >>>> I just looked into some of our custom components
> >>>> there are also some without calling release();
> >>>>
> >>>> Well indeed it should be called in each component
> >>>> tag, as far as I see it.
> >>>>
> >>>> BTW. there was once an issue on a topic related
> >>>> to this (see http://tinyurl.com/5hp77).
> >>>>
> >>>> Perhaps Daniel could point it out?
> >>>>
> >>>> Regards!
> >>>>
> >>>> -Matthias
> >>>>
> >>>> Heath Borders wrote:
> >>>>
> >>>>> I noticed that the only play the release method is called is inside of
> >>>>> UIComponentTag, and not in any of its children.  I don't really know
> >>>>> much about JSP tag development, but I was under the impression that
> >>>>> release should clear all a Tag's instance variables in preparation for
> >>>>> another use.  Is this not this case?  Can I get rid of a lot of
> >>>>> release calls?
> >>>>>
> >>>>
> >>>> --
> >>>> Matthias Weßendorf
> >>>> Aechterhoek 18
> >>>> DE-48282 Emsdetten
> >>>> Germany
> >>>> phone: +49-2572-9170275
> >>>> cell phone: +49-179-1118979
> >>>> email: matzew AT apache DOT org
> >>>> url: http://www.wessendorf.net
> >>>> callto://mwessendorf (Skype)
> >>>> icq: 47016183
> >>>>
> >>>
> >>
> >>
> >
> 
> --
> Matthias Weßendorf
> Aechterhoek 18
> DE-48282 Emsdetten
> Germany
> phone: +49-2572-9170275
> cell phone: +49-179-1118979
> email: matzew AT apache DOT org
> url: http://www.wessendorf.net
> callto://mwessendorf (Skype)
> icq: 47016183
> 


-- 
-Heath Borders-Wing
hborders@mail.win.org

Re: release method not called in MyFaces Tags

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Ok Heath,

I just looked at this hierarchy:

http://incubator.apache.org/myfaces/javadoc/org/apache/myfaces/taglib/html/ext/HtmlSelectOneRadioTag.html

only "javax.faces.webapp.UIComponentTag"
contains a "release()"

So I'll add to *each* Tag clazz I see a method like:

public void release(){
   super.release()

   newIntroducedProperty1 = null;
   ... = null;
}

(e.g. for HtmlSelectOneRadioTag.java I'll set _enabledOnUserRole and 
_visibleOnUserRole both to null)

I started looking at custom tags
and I am still looking a *share* packages.

Which packages did you see?

Thanks for pointing it out!

-Matthias



Matthias Wessendorf wrote:
> Hi Heath,
> 
> yes, I think also!
> 
> So I will look on some tag clazzes during this day.
> 
> -Matthias
> 
> Heath Borders wrote:
> 
>> I understand that, but shouldn't it be considered best practice to
>> have the release method release all resources not needed?  Thus, it
>> would need to be implemented on ever UIComponentTag
>>
>>
>> On Wed, 16 Feb 2005 08:48:35 -0300, Daniel Kamakura
>> <da...@gmail.com> wrote:
>>
>>> Hi all,
>>> The release() method can be used to clean Tag state, to release any
>>> resources that the Tag was using. Notice that it is up to the
>>> Container to call the release() method when seemed fit, so you can't
>>> rely on this method being called at any specific time. In theory, this
>>> method could be called 12 days after the Tag was used. For this
>>> reason, any code that must be executed at the end of the Tag usage
>>> should be called from the doEndTag() method.
>>>
>>> Regards,
>>> Daniel Kamakura
>>>
>>> On Wed, 16 Feb 2005 11:49:57 +0100, Matthias Wessendorf
>>> <ma...@matthias-wessendorf.de> wrote:
>>>
>>>> Hi Heath-
>>>>
>>>> I just looked into some of our custom components
>>>> there are also some without calling release();
>>>>
>>>> Well indeed it should be called in each component
>>>> tag, as far as I see it.
>>>>
>>>> BTW. there was once an issue on a topic related
>>>> to this (see http://tinyurl.com/5hp77).
>>>>
>>>> Perhaps Daniel could point it out?
>>>>
>>>> Regards!
>>>>
>>>> -Matthias
>>>>
>>>> Heath Borders wrote:
>>>>
>>>>> I noticed that the only play the release method is called is inside of
>>>>> UIComponentTag, and not in any of its children.  I don't really know
>>>>> much about JSP tag development, but I was under the impression that
>>>>> release should clear all a Tag's instance variables in preparation for
>>>>> another use.  Is this not this case?  Can I get rid of a lot of
>>>>> release calls?
>>>>>
>>>>
>>>> -- 
>>>> Matthias Weßendorf
>>>> Aechterhoek 18
>>>> DE-48282 Emsdetten
>>>> Germany
>>>> phone: +49-2572-9170275
>>>> cell phone: +49-179-1118979
>>>> email: matzew AT apache DOT org
>>>> url: http://www.wessendorf.net
>>>> callto://mwessendorf (Skype)
>>>> icq: 47016183
>>>>
>>>
>>
>>
> 

-- 
Matthias Weßendorf
Aechterhoek 18
DE-48282 Emsdetten
Germany
phone: +49-2572-9170275
cell phone: +49-179-1118979
email: matzew AT apache DOT org
url: http://www.wessendorf.net
callto://mwessendorf (Skype)
icq: 47016183

Re: release method not called in MyFaces Tags

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Hi Heath,

yes, I think also!

So I will look on some tag clazzes during this day.

-Matthias

Heath Borders wrote:
> I understand that, but shouldn't it be considered best practice to
> have the release method release all resources not needed?  Thus, it
> would need to be implemented on ever UIComponentTag
> 
> 
> On Wed, 16 Feb 2005 08:48:35 -0300, Daniel Kamakura
> <da...@gmail.com> wrote:
> 
>>Hi all,
>>The release() method can be used to clean Tag state, to release any
>>resources that the Tag was using. Notice that it is up to the
>>Container to call the release() method when seemed fit, so you can't
>>rely on this method being called at any specific time. In theory, this
>>method could be called 12 days after the Tag was used. For this
>>reason, any code that must be executed at the end of the Tag usage
>>should be called from the doEndTag() method.
>>
>>Regards,
>>Daniel Kamakura
>>
>>On Wed, 16 Feb 2005 11:49:57 +0100, Matthias Wessendorf
>><ma...@matthias-wessendorf.de> wrote:
>>
>>>Hi Heath-
>>>
>>>I just looked into some of our custom components
>>>there are also some without calling release();
>>>
>>>Well indeed it should be called in each component
>>>tag, as far as I see it.
>>>
>>>BTW. there was once an issue on a topic related
>>>to this (see http://tinyurl.com/5hp77).
>>>
>>>Perhaps Daniel could point it out?
>>>
>>>Regards!
>>>
>>>-Matthias
>>>
>>>Heath Borders wrote:
>>>
>>>>I noticed that the only play the release method is called is inside of
>>>>UIComponentTag, and not in any of its children.  I don't really know
>>>>much about JSP tag development, but I was under the impression that
>>>>release should clear all a Tag's instance variables in preparation for
>>>>another use.  Is this not this case?  Can I get rid of a lot of
>>>>release calls?
>>>>
>>>
>>>--
>>>Matthias Weßendorf
>>>Aechterhoek 18
>>>DE-48282 Emsdetten
>>>Germany
>>>phone: +49-2572-9170275
>>>cell phone: +49-179-1118979
>>>email: matzew AT apache DOT org
>>>url: http://www.wessendorf.net
>>>callto://mwessendorf (Skype)
>>>icq: 47016183
>>>
>>
> 
> 

-- 
Matthias Weßendorf
Aechterhoek 18
DE-48282 Emsdetten
Germany
phone: +49-2572-9170275
cell phone: +49-179-1118979
email: matzew AT apache DOT org
url: http://www.wessendorf.net
callto://mwessendorf (Skype)
icq: 47016183

Re: release method not called in MyFaces Tags

Posted by Heath Borders <he...@gmail.com>.
I understand that, but shouldn't it be considered best practice to
have the release method release all resources not needed?  Thus, it
would need to be implemented on ever UIComponentTag


On Wed, 16 Feb 2005 08:48:35 -0300, Daniel Kamakura
<da...@gmail.com> wrote:
> Hi all,
> The release() method can be used to clean Tag state, to release any
> resources that the Tag was using. Notice that it is up to the
> Container to call the release() method when seemed fit, so you can't
> rely on this method being called at any specific time. In theory, this
> method could be called 12 days after the Tag was used. For this
> reason, any code that must be executed at the end of the Tag usage
> should be called from the doEndTag() method.
> 
> Regards,
> Daniel Kamakura
> 
> On Wed, 16 Feb 2005 11:49:57 +0100, Matthias Wessendorf
> <ma...@matthias-wessendorf.de> wrote:
> > Hi Heath-
> >
> > I just looked into some of our custom components
> > there are also some without calling release();
> >
> > Well indeed it should be called in each component
> > tag, as far as I see it.
> >
> > BTW. there was once an issue on a topic related
> > to this (see http://tinyurl.com/5hp77).
> >
> > Perhaps Daniel could point it out?
> >
> > Regards!
> >
> > -Matthias
> >
> > Heath Borders wrote:
> > > I noticed that the only play the release method is called is inside of
> > > UIComponentTag, and not in any of its children.  I don't really know
> > > much about JSP tag development, but I was under the impression that
> > > release should clear all a Tag's instance variables in preparation for
> > > another use.  Is this not this case?  Can I get rid of a lot of
> > > release calls?
> > >
> >
> > --
> > Matthias Weßendorf
> > Aechterhoek 18
> > DE-48282 Emsdetten
> > Germany
> > phone: +49-2572-9170275
> > cell phone: +49-179-1118979
> > email: matzew AT apache DOT org
> > url: http://www.wessendorf.net
> > callto://mwessendorf (Skype)
> > icq: 47016183
> >
> 


-- 
-Heath Borders-Wing
hborders@mail.win.org

Re: release method not called in MyFaces Tags

Posted by Daniel Kamakura <da...@gmail.com>.
Hi all,
The release() method can be used to clean Tag state, to release any
resources that the Tag was using. Notice that it is up to the
Container to call the release() method when seemed fit, so you can't
rely on this method being called at any specific time. In theory, this
method could be called 12 days after the Tag was used. For this
reason, any code that must be executed at the end of the Tag usage
should be called from the doEndTag() method.

Regards,
Daniel Kamakura

On Wed, 16 Feb 2005 11:49:57 +0100, Matthias Wessendorf
<ma...@matthias-wessendorf.de> wrote:
> Hi Heath-
> 
> I just looked into some of our custom components
> there are also some without calling release();
> 
> Well indeed it should be called in each component
> tag, as far as I see it.
> 
> BTW. there was once an issue on a topic related
> to this (see http://tinyurl.com/5hp77).
> 
> Perhaps Daniel could point it out?
> 
> Regards!
> 
> -Matthias
> 
> Heath Borders wrote:
> > I noticed that the only play the release method is called is inside of
> > UIComponentTag, and not in any of its children.  I don't really know
> > much about JSP tag development, but I was under the impression that
> > release should clear all a Tag's instance variables in preparation for
> > another use.  Is this not this case?  Can I get rid of a lot of
> > release calls?
> >
> 
> --
> Matthias Weßendorf
> Aechterhoek 18
> DE-48282 Emsdetten
> Germany
> phone: +49-2572-9170275
> cell phone: +49-179-1118979
> email: matzew AT apache DOT org
> url: http://www.wessendorf.net
> callto://mwessendorf (Skype)
> icq: 47016183
>

Re: release method not called in MyFaces Tags

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Hi Heath-

I just looked into some of our custom components
there are also some without calling release();

Well indeed it should be called in each component
tag, as far as I see it.

BTW. there was once an issue on a topic related
to this (see http://tinyurl.com/5hp77).

Perhaps Daniel could point it out?

Regards!

-Matthias


Heath Borders wrote:
> I noticed that the only play the release method is called is inside of
> UIComponentTag, and not in any of its children.  I don't really know
> much about JSP tag development, but I was under the impression that
> release should clear all a Tag's instance variables in preparation for
> another use.  Is this not this case?  Can I get rid of a lot of
> release calls?
> 

-- 
Matthias Weßendorf
Aechterhoek 18
DE-48282 Emsdetten
Germany
phone: +49-2572-9170275
cell phone: +49-179-1118979
email: matzew AT apache DOT org
url: http://www.wessendorf.net
callto://mwessendorf (Skype)
icq: 47016183