Re: [PATCH] Setting TagHandlerPool size as InitParameter for jasper servlet

2002-11-15 Thread Torsten Fohrer

i write it yesterday without any build env. 

sorry, for the work...



On Saturday 16 November 2002 05:22, Jan Luehe wrote:
> Torsten,
>
> I've applied your patch.
>
> However, I found the following issues with it:
> > PATCH Content:
> >  Adding handling of init parameter "tagPoolSize"
> >  Changing Generator to use tagPoolSize for initialize TagHandlerPool
> >
> > This should, hopefully, be correctly formatted.
> >
> > Index: resources/messages.properties
> > ===
> > +jsp.warning.tagpoolsize=Warning: Invalid value for the initParam
> > tagpoolsize. Will use the default value of \"5\"
>
> Instead of hardcoding the default pool size in the error message, I
> pass it as an argument.
>
> Also, instead of specifying the default pool size in several places
> (which could get out-of-sync), I now declare it in a single place
> (org.apache.jasper.Constants.MAX_POOL_SIZE).
>
> > Index: EmbededServletOptions.java
> > ===
> > +String tagPoolSize = config.getInitParameter("tagPoolSize");
>
> I don't think it is a good idea in general to have an instance and a
> local variable with the same name (in this case: "tagPoolSize"). I've
> renamed the above "tagPoolSize" to "tagPoolSizeParam".
>
> > +if (checkInterval != null) {
>
> "checkInterval" should be "tagPoolSize".
>
> > Index: Options.java
> > ===
> >  /**
> > + * Size of the tag handler pool.
> > + */
> > +public int getTagPoolSize();
>
> An implementation of this method also must be added to
> org.apache.jasper.JspC, which implements the Options interface.
>
> > Index: compiler/Generator.java
> > ===
> > -   out.println(" = new org.apache.jasper.runtime.TagHandlerPool();");
> > +   out.print(" = new org.apache.jasper.runtime.TagHandlerPool(");
> > + out.print( ctxt.getOptions().getTagPoolSize());
>
> This didn't compile, because there currently is no
> ServletWriter.print() method that takes an int. I added one.
>
> I also added a description of the new "tagPoolSize" init param to
> the default web.xml.
>
>
> Jan
>
>
> --
> To unsubscribe, e-mail:  
>  For additional commands,
> e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: [PATCH] Setting TagHandlerPool size as InitParameter for jasper servlet

2002-11-15 Thread Torsten Fohrer

thanks for applying and correcting my patch.

Torsten


On Saturday 16 November 2002 05:22, Jan Luehe wrote:
> Torsten,
>
> I've applied your patch.
>
> However, I found the following issues with it:
> > PATCH Content:
> >  Adding handling of init parameter "tagPoolSize"
> >  Changing Generator to use tagPoolSize for initialize TagHandlerPool
> >
> > This should, hopefully, be correctly formatted.
> >
> > Index: resources/messages.properties
> > ===
> > +jsp.warning.tagpoolsize=Warning: Invalid value for the initParam
> > tagpoolsize. Will use the default value of \"5\"
>
> Instead of hardcoding the default pool size in the error message, I
> pass it as an argument.
>
> Also, instead of specifying the default pool size in several places
> (which could get out-of-sync), I now declare it in a single place
> (org.apache.jasper.Constants.MAX_POOL_SIZE).
>
> > Index: EmbededServletOptions.java
> > ===
> > +String tagPoolSize = config.getInitParameter("tagPoolSize");
>
> I don't think it is a good idea in general to have an instance and a
> local variable with the same name (in this case: "tagPoolSize"). I've
> renamed the above "tagPoolSize" to "tagPoolSizeParam".
>
> > +if (checkInterval != null) {
>
> "checkInterval" should be "tagPoolSize".
>
> > Index: Options.java
> > ===
> >  /**
> > + * Size of the tag handler pool.
> > + */
> > +public int getTagPoolSize();
>
> An implementation of this method also must be added to
> org.apache.jasper.JspC, which implements the Options interface.
>
> > Index: compiler/Generator.java
> > ===
> > -   out.println(" = new org.apache.jasper.runtime.TagHandlerPool();");
> > +   out.print(" = new org.apache.jasper.runtime.TagHandlerPool(");
> > + out.print( ctxt.getOptions().getTagPoolSize());
>
> This didn't compile, because there currently is no
> ServletWriter.print() method that takes an int. I added one.
>
> I also added a description of the new "tagPoolSize" init param to
> the default web.xml.
>
>
> Jan
>
>
> --
> To unsubscribe, e-mail:  
>  For additional commands,
> e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: [PATCH] Setting TagHandlerPool size as InitParameter for jasper servlet

2002-11-15 Thread Jan Luehe
Torsten,

I've applied your patch.
However, I found the following issues with it:


> PATCH Content:
>  Adding handling of init parameter "tagPoolSize"
>  Changing Generator to use tagPoolSize for initialize TagHandlerPool
> 
> This should, hopefully, be correctly formatted.

> Index: resources/messages.properties
> ===
> +jsp.warning.tagpoolsize=Warning: Invalid value for the initParam tagpoolsize. 
> Will use the default value of \"5\"

Instead of hardcoding the default pool size in the error message, I
pass it as an argument.

Also, instead of specifying the default pool size in several places
(which could get out-of-sync), I now declare it in a single place
(org.apache.jasper.Constants.MAX_POOL_SIZE).


> Index: EmbededServletOptions.java
> ===
> +String tagPoolSize = config.getInitParameter("tagPoolSize");

I don't think it is a good idea in general to have an instance and a
local variable with the same name (in this case: "tagPoolSize"). I've
renamed the above "tagPoolSize" to "tagPoolSizeParam".

> +if (checkInterval != null) {

"checkInterval" should be "tagPoolSize".


> Index: Options.java
> ===
>  /**
> + * Size of the tag handler pool.
> + */
> +public int getTagPoolSize();

An implementation of this method also must be added to
org.apache.jasper.JspC, which implements the Options interface.


> Index: compiler/Generator.java
> ===
> - out.println(" = new org.apache.jasper.runtime.TagHandlerPool();");
> + out.print(" = new org.apache.jasper.runtime.TagHandlerPool(");
> + out.print( ctxt.getOptions().getTagPoolSize());

This didn't compile, because there currently is no
ServletWriter.print() method that takes an int. I added one.

I also added a description of the new "tagPoolSize" init param to
the default web.xml.


Jan


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[PATCH] Setting TagHandlerPool size as InitParameter for jasper servlet

2002-11-15 Thread Torsten Fohrer

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 -	1.58
+++ resources/messages.properties	15 Nov 2002 20:36:19 -
@@ -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 -	1.11
+++ EmbededServletOptions.java	15 Nov 2002 20:36:19 -
@@ -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 -	1.8
+++ Options.java	15 Nov 2002 20:36:20 -
@@ -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 -	1.126
+++ compiler/Generator.java	15 Nov 2002 20:36:22 -
@@ -659,7 +659,9 @@
 	out.pushIndent();
 	for (int i=0; i
--
To unsubscribe, e-mail:   
For additional commands, e-mail: