Bug 46807 - Cannot disable jsp tag pooling
Summary: Cannot disable jsp tag pooling
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 6.0.18
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2009-03-05 12:17 UTC by Eric Abbott
Modified: 2009-03-07 08:16 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Eric Abbott 2009-03-05 12:17:24 UTC
Set jvm param -Dorg.apache.jasper.runtime.JspFactoryImpl.USE_POOL=false.
In web.xml set enablePooling to false.

Created a custom tag that extends 
import javax.servlet.jsp.tagext.BodyTagSupport;

Verified by adding member field
private long creation_time = System.currentTimeMillis();

inside doInitBody()...
  public void doInitBody() {
    System.out.println("creation_time="+ creation_time);
Comment 1 Eric Abbott 2009-03-05 14:00:43 UTC
It appears that once a jsp is compiled (pre or live), tag pooling is no longer changeable via web.xml nor the jvm compiler flag.
Comment 2 Eric Abbott 2009-03-05 15:05:32 UTC
The documentation is misleading when it states:
"Use java system property at server runtime to disable tag pooling org.apache.jasper.runtime.JspFactoryImpl.USE_POOL=false. and limit the buffering with org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true. Note that changing from the defaults may affect performance, but it will vary depending on the application."

The pooling for a given jsp can only be determined at compile time, be it precompiled or compiled by the server.  Also the ant jasper precompile task attribute poolingEnabled unfortunately differs from the web.xml value of enablePooling which can cause confusion.
Comment 3 Mark Thomas 2009-03-07 08:16:45 UTC
Sorry for the confusion.

org.apache.jasper.runtime.JspFactoryImpl.USE_POOL controls the pooling of PageContext objects, not tag instances. I have updated the docs to reflect this.

I have also update the docs to make to clear that enablePooling is a compile time option, not a runtime one.

The changes have been applied to trunk and 6.0.x and will be included in 6.0.20 onwards.