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/compiler Generator.java
Date Fri, 15 Nov 2002 19:41:28 GMT
luehe       2002/11/15 11:41:28

  Modified:    jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Optimization: Do not create JSP fragment for simple tag invocation if
  tag body is empty
  
  Revision  Changes    Path
  1.126     +14 -8     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.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- Generator.java	13 Nov 2002 17:40:38 -0000	1.125
  +++ Generator.java	15 Nov 2002 19:41:28 -0000	1.126
  @@ -1843,8 +1843,11 @@
   	    }
   	    out.printil("try {");
   	    out.pushIndent();
  +	    out.printil("if (getJspBody() != null)");
  +	    out.pushIndent();
   	    out.printil("getJspBody().invoke(_jspx_sout);");
   	    out.popIndent();
  +	    out.popIndent();
   	    out.printil( "} finally {" );
   	    out.pushIndent();
   	    // Copy page scope of invoking page back to virtual page scope of
  @@ -2082,12 +2085,15 @@
   	    if (findJspBody(n) == null) {
   		/*
   		 * Encapsulate body of custom tag invocation in JspFragment
  -		 * and pass it to tag handler's setJspBody()
  +		 * and pass it to tag handler's setJspBody(), unless tag body
  +		 * is empty
   		 */
  -		out.printin(tagHandlerVar);
  -		out.print(".setJspBody(");
  -		generateJspFragment(n, tagHandlerVar);
  -		out.println(");");
  +		if (n.getBody() != null) {
  +		    out.printin(tagHandlerVar);
  +		    out.print(".setJspBody(");
  +		    generateJspFragment(n, tagHandlerVar);
  +		    out.println(");");
  +		}
   	    } else {
   		/*
   		 * Body of tag is the body of the <jsp:body> element.
  
  
  

--
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