PATCH Content: Adding handling of init parameter "tagPoolSize" Changing Generator to use tagPoolSize for initialize TagHandlerPool
This should, hopefully, be correctly formatted. Torsten Fohrer
Index: resources/messages.properties =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v retrieving revision 1.58 diff -u -w -b -r1.58 messages.properties --- resources/messages.properties 8 Nov 2002 19:55:47 -0000 1.58 +++ resources/messages.properties 15 Nov 2002 20:36:19 -0000 @@ -121,6 +121,7 @@ jsp.warning.keepgen=Warning: Invalid value for the initParam keepgenerated. Will use the default value of \"false\" jsp.warning.largeFile=Warning: Invalid value for the initParam largeFile. Will use the default value of \"true\" jsp.warning.enablePooling=Warning: Invalid value for the initParam enablePooling. Will use the default value of \"true\" +jsp.warning.tagpoolsize=Warning: Invalid value for the initParam tagpoolsize. Will use the default value of \"5\" jsp.warning.mappedFile=Warning: Invalid value for the initParam mappedFile. Will use the default value of \"false\" jsp.warning.sendErrToClient=Warning: Invalid value for the initParam sendErrToClient. Will use the default value of \"false\" jsp.warning.classDebugInfo=Warning: Invalid value for the initParam classdebuginfo. Will use the default value of \"false\" Index: EmbededServletOptions.java =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java,v retrieving revision 1.11 diff -u -w -b -r1.11 EmbededServletOptions.java --- EmbededServletOptions.java 22 Oct 2002 22:23:14 -0000 1.11 +++ EmbededServletOptions.java 15 Nov 2002 20:36:19 -0000 @@ -108,6 +108,11 @@ private boolean poolingEnabled = true; /** + * Size of the tag handler pool. + */ + private boolean tagPoolSize = 5; + + /** * Do you want support for "mapped" files? This will generate * servlet that has a print statement per line of the JSP file. * This seems like a really nice feature to have for debugging. @@ -201,6 +206,10 @@ return poolingEnabled; } + public int getTagPoolSize() { + return tagPoolSize; + } + /** * Are we supporting HTML mapped servlets? */ @@ -336,6 +345,21 @@ Logger.WARNING); } + String tagPoolSize = config.getInitParameter("tagPoolSize"); + if (checkInterval != null) { + try { + this.tagPoolSize = Integer.parseInt( tagPoolSize ); + if (this.checkInterval <= 0) { + this.checkInterval = 5; + Constants.message("jsp.warning.tagpoolsize", + Logger.WARNING); + } + } catch(NumberFormatException ex) { + Constants.message ("jsp.warning.tagpoolsize", Logger.WARNING); + } + } + + String mapFile = config.getInitParameter("mappedfile"); if (mapFile != null) { if (mapFile.equalsIgnoreCase("true")) @@ -366,7 +390,7 @@ String checkInterval = config.getInitParameter("checkInterval"); if (checkInterval != null) { try { - this.checkInterval = new Integer(checkInterval).intValue(); + this.checkInterval = Integer.parseInt(checkInterval); if (this.checkInterval == 0) { this.checkInterval = 300; Constants.message("jsp.warning.checkInterval", Index: Options.java =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java,v retrieving revision 1.8 diff -u -w -b -r1.8 Options.java --- Options.java 20 Aug 2002 03:52:18 -0000 1.8 +++ Options.java 15 Nov 2002 20:36:20 -0000 @@ -94,6 +94,11 @@ public boolean isPoolingEnabled(); /** + * Size of the tag handler pool. + */ + public int getTagPoolSize(); + + /** * Are we supporting HTML mapped servlets? */ public boolean getMappedFile(); Index: compiler/Generator.java =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.126 diff -u -w -b -r1.126 Generator.java --- compiler/Generator.java 15 Nov 2002 19:41:28 -0000 1.126 +++ compiler/Generator.java 15 Nov 2002 20:36:22 -0000 @@ -659,7 +659,9 @@ out.pushIndent(); for (int i=0; i<tagHandlerPoolNames.size(); i++) { out.printin((String) tagHandlerPoolNames.elementAt(i)); - out.println(" = new org.apache.jasper.runtime.TagHandlerPool();"); + out.print(" = new org.apache.jasper.runtime.TagHandlerPool("); + out.print( ctxt.getOptions().getTagPoolSize()); + out.println( ");" ); } out.popIndent(); out.printil("}");
-- To unsubscribe, e-mail: <mailto:tomcat-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:tomcat-dev-help@;jakarta.apache.org>