tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r358036 - in /tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime: BodyContentImpl.java JspFactoryImpl.java
Date Tue, 20 Dec 2005 17:02:37 GMT
Author: remm
Date: Tue Dec 20 09:02:33 2005
New Revision: 358036

URL: http://svn.apache.org/viewcvs?rev=358036&view=rev
Log:
- Add two system properties (as given the JSP API, there is no easy solution to
  retrieve configuration parameters elsewhere) to allow configuring Jasper
  memory management. Note that changing from the defaults may affect
  performance, depending on the application.

Modified:
    tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java
    tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/JspFactoryImpl.java

Modified: tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java?rev=358036&r1=358035&r2=358036&view=diff
==============================================================================
--- tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java
(original)
+++ tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java
Tue Dec 20 09:02:33 2005
@@ -40,6 +40,8 @@
     
     private static final String LINE_SEPARATOR = 
         System.getProperty("line.separator");
+    private static final boolean LIMIT_BUFFER = 
+        Boolean.parseBoolean(System.getProperty("org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER",
"false"));
     
     private char[] cb;
     private int nextChar;
@@ -468,6 +470,10 @@
             throw new IOException();
         } else {
             nextChar = 0;
+            if (LIMIT_BUFFER && (cb.length > Constants.DEFAULT_TAG_BUFFER_SIZE))
{
+                bufferSize = Constants.DEFAULT_TAG_BUFFER_SIZE;
+                cb = new char[bufferSize];
+            }
         }
     }
     

Modified: tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/JspFactoryImpl.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/JspFactoryImpl.java?rev=358036&r1=358035&r2=358036&view=diff
==============================================================================
--- tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/JspFactoryImpl.java
(original)
+++ tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/JspFactoryImpl.java
Tue Dec 20 09:02:33 2005
@@ -40,9 +40,10 @@
     private Log log = LogFactory.getLog(JspFactoryImpl.class);
 
     private static final String SPEC_VERSION = "2.0";
-    private static final boolean USE_POOL = true;
+    private static final boolean USE_POOL = 
+        Boolean.parseBoolean(System.getProperty("org.apache.jasper.runtime.JspFactoryImpl.USE_POOL",
"true"));
 
-    private SimplePool pool = new SimplePool( 100 );
+    private SimplePool pool = new SimplePool(100);
     
     public PageContext getPageContext(Servlet servlet,
 				      ServletRequest request,
@@ -51,7 +52,6 @@
                                       boolean needsSession,
 				      int bufferSize,
                                       boolean autoflush) {
-
 	if( System.getSecurityManager() != null ) {
 	    PrivilegedGetPageContext dp = new PrivilegedGetPageContext(
 		(JspFactoryImpl)this, servlet, request, response, errorPageURL,



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message