You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Paul Benedict <pb...@apache.org> on 2006/09/13 07:23:30 UTC

[s1] Question on doEndTag

To accommodate <html:param> nesting, I moved the <html:link> URL 
generating code from doStartTag() to doEndTag(). I don't know if this is 
related, but I noticed that one property is not being cleaned up from 
one instance to the next; that if I successively generated links within 
a page of varying properties, old values would stick around. I was 
hoping for release() to take care of this, but I made a bad assumption 
somewhere. That must be for returning to the container's pool library, 
which must not occur until the page ends and cleans up the tag library 
instances.

Can someone tell me more? I find it strange we do not reset all 
variables in doEndTag(). In my personal development, I have always 
emitted my tag output in doEndTag() and then had a private cleanup() 
method to reset methods for the next iteration. I am not doing that 
here. I didn't see anything like that in the Struts tag library already; 
there's either a style difference here or something more compelling.

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s1] Question on doEndTag

Posted by Paul Benedict <pb...@apache.org>.
One thing I forgot to add:

It's happening on a private variable. This variable is not exposed 
through any getter/setter on the tag library, and thus also not in the TLD.

Paul Benedict wrote:
> To accommodate <html:param> nesting, I moved the <html:link> URL 
> generating code from doStartTag() to doEndTag(). I don't know if this is 
> related, but I noticed that one property is not being cleaned up from 
> one instance to the next; that if I successively generated links within 
> a page of varying properties, old values would stick around. I was 
> hoping for release() to take care of this, but I made a bad assumption 
> somewhere. That must be for returning to the container's pool library, 
> which must not occur until the page ends and cleans up the tag library 
> instances.
> 
> Can someone tell me more? I find it strange we do not reset all 
> variables in doEndTag(). In my personal development, I have always 
> emitted my tag output in doEndTag() and then had a private cleanup() 
> method to reset methods for the next iteration. I am not doing that 
> here. I didn't see anything like that in the Struts tag library already; 
> there's either a style difference here or something more compelling.
> 
> Paul
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s1] Question on doEndTag

Posted by Martin Cooper <ma...@apache.org>.
On 9/12/06, Paul Benedict <pb...@apache.org> wrote:
>
> To accommodate <html:param> nesting, I moved the <html:link> URL
> generating code from doStartTag() to doEndTag(). I don't know if this is
> related, but I noticed that one property is not being cleaned up from
> one instance to the next; that if I successively generated links within
> a page of varying properties, old values would stick around. I was
> hoping for release() to take care of this, but I made a bad assumption
> somewhere. That must be for returning to the container's pool library,
> which must not occur until the page ends and cleans up the tag library
> instances.
>
> Can someone tell me more? I find it strange we do not reset all
> variables in doEndTag(). In my personal development, I have always
> emitted my tag output in doEndTag() and then had a private cleanup()
> method to reset methods for the next iteration. I am not doing that
> here. I didn't see anything like that in the Struts tag library already;
> there's either a style difference here or something more compelling.


You probably want to give a careful read to the JSP spec, particularly the
parts about tag lifecycles and AttSets. In the JSP 2.0 spec, the text on
page 2-54 and the diagram on page 2-55 should get you started. I'd say this
is the least understood part of the JSP spec, but it's crucial to
understanding how tags really work, how tag pooling works, and what the
container can assume about the state of tag handler instances.

--
Martin Cooper


Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>