On 9/12/06, Paul Benedict <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to