We are trying to figure out if tag handler objects are re-used, or
instantiated-and-destroyed at every request. This is obviously important
for performance reasons.
There is conflicting information in JSP spec and on JGuru (see references
below). So maybe it's an implementation-specific issue. Which brings me
to the question:
What does Orion do with tag handler instances? Reuse or reinstantiate them?
JSP spec 1.1, paragraph 5.4.7:
At execution time the implementation of a JSP page will use an available Tag
instance with
the appropriate prefix and name that is not being used, initialize it, and
then follow the
protocol described below. Afterwards, it will release the instance and make
it available for
further use. This approach reduces the number of instances that are needed
at a time.
http://www.jguru.com/jguru/faq/view.jsp?EID=337618
Question We want to make sure that our JSP development efforts are
thread-safe. Is it possible that two threads will access one instance of a
JSP custom tag handler concurrently?
No it is not possible. There is a defined lifecycle of a custom tag, and
during this lifecycle, that instance of the tag will only get called once.
Hopefully in newer implementations of JSP engines, the actual tag object
will not get reinstantiated each time (as this negatively affects
performance), but at least during it's use, it will be thread safe.
--
Bart Blacha, Software Developer
NetPerceptions Inc.
(512) 349-5622
[EMAIL PROTECTED]