You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jochen Wuttke <wu...@lu.unisi.ch> on 2008/10/15 14:21:13 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 unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org