tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compiler BeanGenerator.java GetPropertyGenerator.java JspParseEventListener.java SetPropertyGenerator.java StoredCharDataGenerator.java TagBeginGenerator.java TagEndGenerator.java
Date Fri, 09 Mar 2001 22:26:16 GMT
costin      01/03/09 14:26:15

  Modified:    src/share/org/apache/jasper Constants.java
               src/share/org/apache/jasper/compiler BeanGenerator.java
                        GetPropertyGenerator.java
                        JspParseEventListener.java
                        SetPropertyGenerator.java
                        StoredCharDataGenerator.java TagBeginGenerator.java
                        TagEndGenerator.java
  Log:
  Fix bug 434, jasper importing more than it should
  
  javax.servlet.jsp.tagext is still imported ( even if it is not in the
  list), watchdog must be fixed first.
  
  Thanks to drees@ebetinc.com for reporting the bug.
  
  Revision  Changes    Path
  1.17      +16 -7     jakarta-tomcat/src/share/org/apache/jasper/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Constants.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Constants.java	2001/02/20 03:36:00	1.16
  +++ Constants.java	2001/03/09 22:26:12	1.17
  @@ -72,7 +72,8 @@
       /**
        * The base class of the generated servlets. 
        */
  -    public static final String JSP_SERVLET_BASE = "HttpJspBase";
  +    public static final String JSP_SERVLET_BASE =
  +	"org.apache.jasper.runtime.HttpJspBase";
   
       /**
        * _jspService is the name of the method that is called by 
  @@ -94,13 +95,21 @@
        *        with all our generators -akv.
        */
       public static final String[] STANDARD_IMPORTS = { 
  -	"javax.servlet.*", "javax.servlet.http.*", "javax.servlet.jsp.*", 
  -        "javax.servlet.jsp.tagext.*",
  -	"java.io.PrintWriter", "java.io.IOException", "java.io.FileInputStream",
  -        "java.io.ObjectInputStream", "java.util.Vector",
  -	"org.apache.jasper.runtime.*", "java.beans.*",
  -	"org.apache.jasper.JasperException"
  +	"javax.servlet.*",
  +	"javax.servlet.http.*",
  +	"javax.servlet.jsp.*",
  +	// This one is not in spec, but a lot of tests depend on it.
  +	// The code is fixed to use explicit deps, when we test
  +	// the watchdog tests we can remove this
  +	"javax.servlet.jsp.tagext.*"
       };
  +    
  +//         "javax.servlet.jsp.tagext.*",
  +// 	"java.io.PrintWriter", "java.io.IOException", "java.io.FileInputStream",
  +//         "java.io.ObjectInputStream", "java.util.Vector",
  +// 	"org.apache.jasper.runtime.*", "java.beans.*",
  +// 	"org.apache.jasper.JasperException"
  +//     };
   
       /**
        * ServletContext attribute for classpath. This is tomcat specific. 
  
  
  
  1.9       +5 -5      jakarta-tomcat/src/share/org/apache/jasper/compiler/BeanGenerator.java
  
  Index: BeanGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/BeanGenerator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BeanGenerator.java	2000/07/13 16:51:57	1.8
  +++ BeanGenerator.java	2001/03/09 22:26:13	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/BeanGenerator.java,v
1.8 2000/07/13 16:51:57 alex Exp $
  - * $Revision: 1.8 $
  - * $Date: 2000/07/13 16:51:57 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/BeanGenerator.java,v
1.9 2001/03/09 22:26:13 costin Exp $
  + * $Revision: 1.9 $
  + * $Date: 2001/03/09 22:26:13 $
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  @@ -345,11 +345,11 @@
   	writer.pushIndent ();
   	if (beanRT == false)
   	    writer.println(varname+" = ("+ convert + 
  -			   ") Beans.instantiate(this.getClass().getClassLoader(), "+
  +			   ") java.beans.Beans.instantiate(this.getClass().getClassLoader(), "+
   			   writer.quoteString(clsname) +");");
   	else
   	    writer.println(varname+" = ("+ convert + 
  -			   ") Beans.instantiate(this.getClass().getClassLoader(), "+
  +			   ") java.beans.Beans.instantiate(this.getClass().getClassLoader(), "+
   			   clsname +");");
   	writer.popIndent ();
   	writer.println ("} catch (Exception exc) {");
  
  
  
  1.4       +5 -5      jakarta-tomcat/src/share/org/apache/jasper/compiler/GetPropertyGenerator.java
  
  Index: GetPropertyGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/GetPropertyGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GetPropertyGenerator.java	2000/01/12 07:11:14	1.3
  +++ GetPropertyGenerator.java	2001/03/09 22:26:13	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/GetPropertyGenerator.java,v
1.3 2000/01/12 07:11:14 shemnon Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/01/12 07:11:14 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/GetPropertyGenerator.java,v
1.4 2001/03/09 22:26:13 costin Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/03/09 22:26:13 $
    *
    * ====================================================================
    * 
  @@ -101,12 +101,12 @@
                   java.lang.reflect.Method meth = JspRuntimeLibrary.getReadMethod(cls, property);
                   
                   String methodName = meth.getName();
  -		writer.println("out.print(JspRuntimeLibrary.toString(" +
  +		writer.println("out.print(org.apache.jasper.runtime.JspRuntimeLibrary.toString(" +
   			       "(((" + clsName + ")pageContext.findAttribute(" +
                                  "\"" + name + "\"))." + methodName + "())));");
   	    } else {
                   // Get the class name and then introspect at runtime.
  -		writer.println("out.print(JspRuntimeLibrary.toString(JspRuntimeLibrary." +
  +		writer.println("out.print(org.apache.jasper.runtime.JspRuntimeLibrary.toString(JspRuntimeLibrary."
+
   			       "handleGetProperty(pageContext.findAttribute(" +
   			       "\"" + name + "\"), \"" + property + "\")));");
   	    }
  
  
  
  1.23      +6 -8      jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java
  
  Index: JspParseEventListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- JspParseEventListener.java	2001/03/02 04:51:33	1.22
  +++ JspParseEventListener.java	2001/03/09 22:26:13	1.23
  @@ -272,7 +272,7 @@
           writer.println("private static boolean _jspx_inited = false;");
           writer.println();
   
  -        writer.println("public final void _jspx_init() throws JasperException {");
  +        writer.println("public final void _jspx_init() throws org.apache.jasper.JasperException
{");
           writer.pushIndent();
   	generateAll(InitMethodPhase.class);
           writer.popIndent();
  @@ -284,7 +284,7 @@
   		       "HttpServletRequest request, "+
   		       "HttpServletResponse  response)");
   
  -	writer.println("    throws IOException, ServletException {");
  +	writer.println("    throws java.io.IOException, ServletException {");
   	writer.pushIndent();
   	writer.println();
           writer.println("JspFactory _jspxFactory = null;");
  @@ -355,12 +355,10 @@
   	writer.pushIndent();
   	/* Do stuff here for finally actions... */
           //writer.println("out.close();");
  -	//	writer.println("System.out.println(JspWriterImpl.class.getClassLoader());");
  -	//	writer.println("System.out.println(out.getClass().getClassLoader());");
  -	//writer.println("if (out instanceof JspWriterImpl) { ");
  -        //writer.println("    ((JspWriterImpl)out).flushBuffer();");
  -	//writer.println("}");
  -	writer.println("out.flush();");
  +
  +	writer.println("if (out instanceof org.apache.jasper.runtime.JspWriterImpl) { ");
  +        writer.println("    ((org.apache.jasper.runtime.JspWriterImpl)out).flushBuffer();");
  +	writer.println("}");
   	writer.println("if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);");
   	writer.popIndent();
   	writer.println("}");
  
  
  
  1.6       +7 -7      jakarta-tomcat/src/share/org/apache/jasper/compiler/SetPropertyGenerator.java
  
  Index: SetPropertyGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/SetPropertyGenerator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SetPropertyGenerator.java	2000/06/11 21:41:06	1.5
  +++ SetPropertyGenerator.java	2001/03/09 22:26:13	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/SetPropertyGenerator.java,v
1.5 2000/06/11 21:41:06 mandar Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/06/11 21:41:06 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/SetPropertyGenerator.java,v
1.6 2001/03/09 22:26:13 costin Exp $
  + * $Revision: 1.6 $
  + * $Date: 2001/03/09 22:26:13 $
    *
    * ====================================================================
    * 
  @@ -103,7 +103,7 @@
   		}
   		
   		// Set all the properties using name-value pairs in the request.
  -		writer.println("JspRuntimeLibrary.introspect(pageContext.findAttribute(" +
  +		writer.println("org.apache.jasper.runtime.JspRuntimeLibrary.introspect(pageContext.findAttribute("
+
   			       "\"" + name + "\"), request);");		
   		
   	    } else {
  @@ -113,7 +113,7 @@
   		    // Parameter name specified. If not same as property.
   		    if (param == null) param = property;
   		    
  -		    writer.println("JspRuntimeLibrary.introspecthelper(pageContext." +
  +		    writer.println("org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(pageContext."
+
   				   "findAttribute(\"" + name + "\"), \"" + property +
   				   "\", request.getParameter(\"" + param + "\"), " +
   				   "request, \"" + param + "\", false);");
  @@ -121,7 +121,7 @@
   		    
   		    // value is a constant.
   		    if (!JspUtil.isExpression (value)) {
  -			writer.println("JspRuntimeLibrary.introspecthelper(pageContext." +
  +			writer.println("org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(pageContext."
+
   				       "findAttribute(\"" + name + "\"), \"" + property +
   				       "\",\"" + JspUtil.escapeQueryString(value) +
   				       "\",null,null, false);");
  @@ -129,7 +129,7 @@
   			
   			// This requires some careful handling.
   			// int, boolean, ... are not Object(s).
  -			writer.println("JspRuntimeLibrary.handleSetProperty(pageContext." +
  +			writer.println("org.apache.jasper.runtime.JspRuntimeLibrary.handleSetProperty(pageContext."
+
   				       "findAttribute(\"" + name + "\"), \"" + property +
   				       "\"," + JspUtil.getExpr(value) + ");");
   		    }
  
  
  
  1.2       +5 -5      jakarta-tomcat/src/share/org/apache/jasper/compiler/StoredCharDataGenerator.java
  
  Index: StoredCharDataGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/StoredCharDataGenerator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StoredCharDataGenerator.java	1999/10/09 00:20:38	1.1
  +++ StoredCharDataGenerator.java	2001/03/09 22:26:14	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/StoredCharDataGenerator.java,v
1.1 1999/10/09 00:20:38 duncan Exp $
  - * $Revision: 1.1 $
  - * $Date: 1999/10/09 00:20:38 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/StoredCharDataGenerator.java,v
1.2 2001/03/09 22:26:14 costin Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/03/09 22:26:14 $
    *
    * ====================================================================
    * 
  @@ -107,13 +107,13 @@
               writer.popIndent();
               writer.println("} catch (Exception ex) {");
               writer.pushIndent();
  -            writer.println("throw new JasperException(\"Unable to open data file\");");
  +            writer.println("throw new org.apache.jasper.JasperException(\"Unable to open
data file\");");
               writer.popIndent();
               writer.println("} finally {");
               writer.pushIndent();
               writer.println("if (oin != null)");
               writer.pushIndent();
  -            writer.println("try { oin.close(); } catch (IOException ignore) { }");
  +            writer.println("try { oin.close(); } catch (java.io.IOException ignore) { }");
               writer.popIndent();
               writer.popIndent();
               writer.println("}");
  
  
  
  1.18      +5 -5      jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java
  
  Index: TagBeginGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- TagBeginGenerator.java	2001/01/07 19:24:20	1.17
  +++ TagBeginGenerator.java	2001/03/09 22:26:14	1.18
  @@ -311,31 +311,31 @@
           //        types of exceptions? -akv
   
           if (implementsBodyTag) {
  -            writer.println("if ("+evalVar+" == Tag.EVAL_BODY_INCLUDE)");
  +            writer.println("if ("+evalVar+" == javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)");
               writer.pushIndent();
               writer.println("throw new JspTagException(\"Since tag handler "+tc.getTagHandlerClass()+
                              " implements BodyTag, it can't return Tag.EVAL_BODY_INCLUDE\");");
               writer.popIndent();
           } else {
  -            writer.println("if ("+evalVar+" == BodyTag.EVAL_BODY_TAG)");
  +            writer.println("if ("+evalVar+" == javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_TAG)");
               writer.pushIndent();
               writer.println("throw new JspTagException(\"Since tag handler "+tc.getTagHandlerClass()+
                              " does not implement BodyTag, it can't return BodyTag.EVAL_BODY_TAG\");");
               writer.popIndent();
           }
   
  -        writer.println("if ("+evalVar+" != Tag.SKIP_BODY) {");
  +        writer.println("if ("+evalVar+" != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {");
   	writer.pushIndent();
   
   	if (implementsBodyTag) {
               writer.println("try {");
               writer.pushIndent();
   
  -	    writer.println("if ("+evalVar+" != Tag.EVAL_BODY_INCLUDE) {");
  +	    writer.println("if ("+evalVar+" != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
{");
   	    writer.pushIndent();
   
   	    writer.println("out = pageContext.pushBody();");
  -	    writer.println(thVarName+".setBodyContent((BodyContent) out);");
  +	    writer.println(thVarName+".setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);");
   
   	    writer.popIndent();
   	    writer.println("}");
  
  
  
  1.9       +3 -3      jakarta-tomcat/src/share/org/apache/jasper/compiler/TagEndGenerator.java
  
  Index: TagEndGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagEndGenerator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TagEndGenerator.java	2000/07/03 09:11:18	1.8
  +++ TagEndGenerator.java	2001/03/09 22:26:14	1.9
  @@ -110,7 +110,7 @@
   	writer.popIndent();
   
           if (implementsBodyTag)
  -            writer.println("} while ("+thVarName+".doAfterBody() == BodyTag.EVAL_BODY_TAG);");
  +            writer.println("} while ("+thVarName+".doAfterBody() == javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_TAG);");
           else
               writer.println("} while (false);");
   
  @@ -131,7 +131,7 @@
   
               writer.println("} finally {");
               writer.pushIndent();
  -            writer.println("if ("+evalVarName+" != Tag.EVAL_BODY_INCLUDE)");
  +            writer.println("if ("+evalVarName+" != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)");
               writer.pushIndent();
               writer.println("out = pageContext.popBody();");
               writer.popIndent();
  @@ -143,7 +143,7 @@
   	writer.popIndent(); // EVAL_BODY
   	writer.println("}");
   
  -	writer.println("if ("+thVarName+".doEndTag() == Tag.SKIP_PAGE)");
  +	writer.println("if ("+thVarName+".doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)");
   	writer.pushIndent(); writer.println("return;"); writer.popIndent();
   
   	writer.popIndent(); // try
  
  
  

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


Mime
View raw message