tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties messages_es.properties messages_ja.properties
Date Wed, 26 Jun 2002 16:50:39 GMT
luehe       2002/06/26 09:50:38

  Modified:    jasper2/src/share/org/apache/jasper
                        EmbededServletOptions.java JspC.java Options.java
               jasper2/src/share/org/apache/jasper/compiler Generator.java
               jasper2/src/share/org/apache/jasper/resources
                        messages.properties messages_es.properties
                        messages_ja.properties
  Log:
  Added boolean context init parameter 'enablePooling', which determines
  whether tag handler pooling is turned on (true by default)
  
  Revision  Changes    Path
  1.8       +27 -5     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java
  
  Index: EmbededServletOptions.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EmbededServletOptions.java	20 Jun 2002 22:48:44 -0000	1.7
  +++ EmbededServletOptions.java	26 Jun 2002 16:50:37 -0000	1.8
  @@ -100,7 +100,12 @@
        * data being used literally in the generated servlet. 
        */
       public boolean largeFile = false;
  -    
  +
  +    /**
  +     * Determines whether tag handler pooling is enabled.
  +     */
  +    public boolean poolingEnabled = true;
  +
       /**
        * Do you want support for "mapped" files? This will generate
        * servlet that has a print statement per line of the JSP file.
  @@ -185,6 +190,10 @@
       public boolean getLargeFile() {
           return largeFile;
       }
  +
  +    public boolean isPoolingEnabled() {
  +	return poolingEnabled;
  +    }
       
       /**
        * Are we supporting HTML mapped servlets?
  @@ -274,7 +283,9 @@
        * Create an EmbededServletOptions object using data available from
        * ServletConfig and ServletContext. 
        */
  -    public EmbededServletOptions(ServletConfig config, ServletContext context) {
  +    public EmbededServletOptions(ServletConfig config,
  +				 ServletContext context) {
  +
           Enumeration enum=config.getInitParameterNames();
           while( enum.hasMoreElements() ) {
               String k=(String)enum.nextElement();
  @@ -313,6 +324,17 @@
               else if (mapFile.equalsIgnoreCase("false"))
                   this.mappedFile = false;
               else Constants.message ("jsp.warning.mappedFile", Logger.WARNING);
  +        }
  +
  +	poolingEnabled = true;
  +        String poolingEnabledParam
  +	    = config.getInitParameter("enablePooling"); 
  +        if (poolingEnabledParam != null
  +  	        && !poolingEnabledParam.equalsIgnoreCase("true")) {
  +            if (poolingEnabledParam.equalsIgnoreCase("false"))
  +                this.poolingEnabled = false;
  +            else Constants.message("jsp.warning.enablePooling",
  +				   Logger.WARNING);
           }
   	
           String senderr = config.getInitParameter("sendErrToClient");
  
  
  
  1.12      +7 -3      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JspC.java	20 Jun 2002 22:49:54 -0000	1.11
  +++ JspC.java	26 Jun 2002 16:50:38 -0000	1.12
  @@ -205,6 +205,10 @@
           return largeFile;
       }
   
  +    public boolean isPoolingEnabled() {
  +        return true;
  +    }
  +
       /**
        * Are we supporting HTML mapped servlets?
        */
  
  
  
  1.6       +7 -3      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java
  
  Index: Options.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Options.java	31 May 2002 05:13:13 -0000	1.5
  +++ Options.java	26 Jun 2002 16:50:38 -0000	1.6
  @@ -89,6 +89,10 @@
        */
       public boolean getLargeFile();
   
  +    /**
  +     * Returns true if tag handler pooling is enabled, false otherwise.
  +     */
  +    public boolean isPoolingEnabled();
   
       /**
        * Are we supporting HTML mapped servlets?
  
  
  
  1.34      +41 -22    jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- Generator.java	21 Jun 2002 23:29:22 -0000	1.33
  +++ Generator.java	26 Jun 2002 16:50:38 -0000	1.34
  @@ -394,8 +394,12 @@
   
    	// Class variable declarations
        	
  -	// Declare tag pools, one per (tag with specific attribute list).
  -	if (!tagHandlerPoolNames.isEmpty()) {
  +	/*
  +	 * Declare tag handler pools (tags of the same type and with the same
  +	 * attribute set share the same tag handler pool)
  +	 */
  +	if (ctxt.getOptions().isPoolingEnabled()
  +	        && !tagHandlerPoolNames.isEmpty()) {
   	    for (int i=0; i<tagHandlerPoolNames.size(); i++) {
   		out.printil("private org.apache.jasper.runtime.TagHandlerPool "
   			    + tagHandlerPoolNames.elementAt(i) + ";");
  @@ -404,7 +408,8 @@
   	}
    
   	// Constructor
  -	if (!tagHandlerPoolNames.isEmpty()) {
  +	if (ctxt.getOptions().isPoolingEnabled()
  +	        && !tagHandlerPoolNames.isEmpty()) {
   	    generateServletConstructor(servletClassName);
   	}
    
  @@ -418,7 +423,8 @@
           out.printil("}");
           out.println();
   
  -	if (!tagHandlerPoolNames.isEmpty()) {
  +	if (ctxt.getOptions().isPoolingEnabled()
  +	        && !tagHandlerPoolNames.isEmpty()) {
   	    generateDestroy();
   	}
    
  @@ -546,7 +552,8 @@
   	/**
   	 * Constructor.
   	 */
  -	public GenerateVisitor(ServletWriter out, MethodsBuffer methodsBuffer) {
  +	public GenerateVisitor(ServletWriter out,
  +			       MethodsBuffer methodsBuffer) {
   	    this.out = out;
   	    this.methodsBuffer = methodsBuffer;
   	    methodNesting = 0;
  @@ -1314,13 +1321,20 @@
   	    out.printin(tagHandlerClass.getName());
   	    out.print(" ");
   	    out.print(tagHandlerVar);
  -	    out.print(" = (");
  -	    out.print(tagHandlerClass.getName());
  -	    out.print(") ");
  -	    out.print(n.getTagHandlerPoolName());
  -	    out.print(".get(");
  -	    out.print(tagHandlerClass.getName());
  -	    out.println(".class);");
  +	    out.print(" = ");
  +	    if (ctxt.getOptions().isPoolingEnabled()) {
  +		out.print("(");
  +		out.print(tagHandlerClass.getName());
  +		out.print(") ");
  +		out.print(n.getTagHandlerPoolName());
  +		out.print(".get(");
  +		out.print(tagHandlerClass.getName());
  +		out.println(".class);");
  +	    } else {
  +		out.print("new ");
  +		out.print(tagHandlerClass.getName());
  +		out.println("();");
  +	    }
   
   	    generateSetters(n, tagHandlerVar, handlerInfo);
   	    
  @@ -1436,17 +1450,18 @@
                   out.pushIndent();
   		out.printin(tagHandlerVar);
   		out.println(".doFinally();");
  +            }
  +
  +	    if (ctxt.getOptions().isPoolingEnabled()) {
                   out.printin(n.getTagHandlerPoolName());
                   out.print(".reuse(");
   		out.print(tagHandlerVar);
   		out.println(");");
  +	    }
  +
  +	    if (implementsTryCatchFinally) {
                   out.popIndent();
                   out.println("}");
  -            } else {
  -                out.printin(n.getTagHandlerPoolName());
  -                out.print(".reuse(");
  -		out.print(tagHandlerVar);
  -		out.println(");");
   	    }
   
   	    // Synchronize AT_END variables
  @@ -1873,7 +1888,9 @@
   	pageInfo = compiler.getPageInfo();
   	beanInfo = pageInfo.getBeanRepository();
   	breakAtLF = ctxt.getOptions().getMappedFile();
  -	tagHandlerPoolNames = new Vector();
  +	if (ctxt.getOptions().isPoolingEnabled()) {
  +	    tagHandlerPoolNames = new Vector();
  +	}
       }
   
       /**
  @@ -1886,7 +1903,9 @@
   				Node.Nodes page) throws JasperException {
   	Generator gen = new Generator(out, compiler);
   
  -	gen.compileTagHandlerPoolList(page);
  +	if (gen.ctxt.getOptions().isPoolingEnabled()) {
  +	    gen.compileTagHandlerPoolList(page);
  +	}
   	gen.generatePreamble(page);
   	page.visit(gen.new GenerateVisitor(out, gen.methodsBuffer));
   	gen.generatePostamble(page);
  
  
  
  1.8       +3 -3      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- messages.properties	24 May 2002 23:57:42 -0000	1.7
  +++ messages.properties	26 Jun 2002 16:50:38 -0000	1.8
  @@ -112,8 +112,8 @@
   jsp.error.setproperty.paramOrValue=setProperty: either param or value can be present
   jsp.error.setproperty.arrayVal=setProperty: can't set array property {0} through a string
constant value
   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.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.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\"
  
  
  
  1.2       +2 -1      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_es.properties
  
  Index: messages_es.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_es.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- messages_es.properties	28 Mar 2002 18:46:19 -0000	1.1
  +++ messages_es.properties	26 Jun 2002 16:50:38 -0000	1.2
  @@ -97,6 +97,7 @@
   jsp.error.setproperty.arrayVal=setProperty: No puede escribir a la propiedad de array {0}
a traves de una valor de cadena literal
   jsp.warning.keepgen=Aviso: valor incorrecto para el initParam keepgen. Se usara el valor
por defecto de \"false\"
   jsp.warning.largeFile=Aviso: valor incorrecto para el initParam largeFile. se usara el
valor por defecto de \"true\"
  +jsp.warning.enablePooling=Aviso: valor incorrecto para el initParam enablePooling. se usara
el valor por defecto de \"true\"
   jsp.warning.mappedFile=Aviso: valor incorrecto para the initParam mappedFile. se usara
el valor por defecto de \"false\"
   jsp.warning.sendErrToClient=Aviso: valor incorrecto para the initParam sendErrToClient.
se usara el valor por defecto de \"false\"
   jsp.warning.classDebugInfo=Aviso: valor incorrecto para the initParam classdebuginfo. se
usara el valor por defecto de \"false\"
  
  
  
  1.2       +2 -1      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_ja.properties
  
  Index: messages_ja.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_ja.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- messages_ja.properties	28 Mar 2002 18:46:19 -0000	1.1
  +++ messages_ja.properties	26 Jun 2002 16:50:38 -0000	1.2
  @@ -109,6 +109,7 @@
   jsp.error.setproperty.arrayVal=setProperty: \u5c5e\u6027\u914d\u5217 {0} \u3092\u6587\u5b57\u5217\u5b9a\u6570\u5024\u3067\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093
   jsp.warning.keepgen=\u8b66\u544a: initParam keepgenerated\u306e\u5024\u304c\u7121\u52b9\u3067\u3059\u3002
\u30c7\u30d5\u30a9\u30eb\u30c8\u5024 \"false\" \u3092\u4f7f\u7528\u3057\u307e\u3059
   jsp.warning.largeFile=\u8b66\u544a: initParam largeFile\u306e\u5024\u304c\u7121\u52b9\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u5024
\"true\" \u3092\u4f7f\u7528\u3057\u307e\u3059
  +jsp.warning.enablePooling=\u8b66\u544a: initParam enablePooling\u306e\u5024\u304c\u7121\u52b9\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u5024
\"true\" \u3092\u4f7f\u7528\u3057\u307e\u3059
   jsp.warning.mappedFile=\u8b66\u544a: initParam mappedFile\u306e\u5024\u304c\u7121\u52b9\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u5024
\"false\" \u3092\u4f7f\u7528\u3057\u307e\u3059
   jsp.warning.sendErrToClient=\u8b66\u544a: initParam sendErrToClient\u306e\u5024\u304c\u7121\u52b9\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u5024
\"false\" \u3092\u4f7f\u7528\u3057\u307e\u3059
   jsp.warning.classDebugInfo=\u8b66\u544a: initParam classdebuginfo\u306e\u5024\u304c\u7121\u52b9\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u5024
\"false\"\u3092\u4f7f\u7528\u3057\u307e\u3059
  
  
  

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


Mime
View raw message