You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jochen Wuttke <wu...@lu.unisi.ch> on 2008/10/16 11:03:53 UTC
Potential reuse of TagHandlers implementing JspIdConsumer?
Hi,
for my research project I've been doing some ApsectJ magic with Tomcat
and deployed WebApps. Among other things I'm interested in detecting
at runtime when TagHandlers instantiated in a HttpServlet go out of
scope. Since that can't be done with AspectJ I was tracking garbage
collection to see when the objects get removed. To be sure that that
made some sense I looked at where the servlet code instantiates the
TagHandlers, and since they are created and used as local variables, I
was expecting them to be collected after the servlet finishes
processing.
Unfortunately, a few experiments showed that that is not the case.
After delving into the details of the servlet code generated for JSP
pages I discovered that the methods instantiating TagHandlers also
store them in TagHandlerPools using #reuse().
I'm doing my experiments with a demo application for Java Server
Faces, and all JSF tag handler implement
javax.servlet.jsp.tagext.JspIdConsumer. The spec says that handler
implementing that interface may not be reused, so I was wondering if
this is a potential bug or if I'm missing some intricate detail of how
things work.
Thanks,
Jochen
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Potential reuse of TagHandlers implementing JspIdConsumer?
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jochen,
I'd definitely like to know the answer to this, too. Replying to bump
the topic.
- -chris
Jochen Wuttke wrote:
> Hi,
>
> for my research project I've been doing some ApsectJ magic with Tomcat
> and deployed WebApps. Among other things I'm interested in detecting at
> runtime when TagHandlers instantiated in a HttpServlet go out of scope.
> Since that can't be done with AspectJ I was tracking garbage collection
> to see when the objects get removed. To be sure that that made some
> sense I looked at where the servlet code instantiates the TagHandlers,
> and since they are created and used as local variables, I was expecting
> them to be collected after the servlet finishes processing.
> Unfortunately, a few experiments showed that that is not the case.
> After delving into the details of the servlet code generated for JSP
> pages I discovered that the methods instantiating TagHandlers also store
> them in TagHandlerPools using #reuse().
> I'm doing my experiments with a demo application for Java Server Faces,
> and all JSF tag handler implement
> javax.servlet.jsp.tagext.JspIdConsumer. The spec says that handler
> implementing that interface may not be reused, so I was wondering if
> this is a potential bug or if I'm missing some intricate detail of how
> things work.
>
> Thanks,
> Jochen
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkj8ivkACgkQ9CaO5/Lv0PBVxgCeMV3deLI4A+CtT+WY26+DLV3/
K7IAnR0nNeb29DYPoTf6V6M88HVeeojm
=rlNa
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org