tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From man...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compiler Compiler.java JspCompiler.java JspUtil.java
Date Fri, 04 Feb 2000 01:37:15 GMT
mandar      00/02/03 17:37:15

  Modified:    src/share/org/apache/jasper/compiler Tag: latest_TOMCAT_30
                        Compiler.java JspCompiler.java JspUtil.java
  Log:
  1) Taking out the jsp:expr syntax from JspUtil
  2) Ensuring that classname is not null in JspEngineContext
     -- esp. important for persistant workdir.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.2   +10 -10    jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- Compiler.java	2000/02/03 02:57:44	1.3.2.1
  +++ Compiler.java	2000/02/04 01:37:14	1.3.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v
1.3.2.1 2000/02/03 02:57:44 mandar Exp $
  - * $Revision: 1.3.2.1 $
  - * $Date: 2000/02/03 02:57:44 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v
1.3.2.2 2000/02/04 01:37:14 mandar Exp $
  + * $Revision: 1.3.2.2 $
  + * $Date: 2000/02/04 01:37:14 $
    *
    * ====================================================================
    * 
  @@ -100,14 +100,16 @@
       public boolean compile()
           throws FileNotFoundException, JasperException, Exception 
       {
  -        if (!isOutDated())
  -            return false;
  -        
  +
           String pkgName = mangler.getPackageName();
           String className = mangler.getClassName();
           String javaFileName = mangler.getJavaFileName();
           String classFileName = mangler.getClassFileName();
   
  +        ctxt.setServletClassName(className);
  +        ctxt.setServletPackageName(pkgName);
  +        ctxt.setServletJavaFileName(javaFileName);
  +	
           Constants.message("jsp.message.package_name_is",
                             new Object[] { pkgName },
                             Constants.MED_VERBOSITY);
  @@ -120,7 +122,8 @@
           Constants.message("jsp.message.class_file_name_is",
                             new Object[] { classFileName },
                             Constants.MED_VERBOSITY);
  -
  +        if (!isOutDated())
  +            return false;
           
           // Need the encoding specified in the JSP 'page' directive for
           //  - reading the JSP page
  @@ -160,9 +163,6 @@
   
           ctxt.setReader(reader);
           ctxt.setWriter(writer);
  -        ctxt.setServletClassName(className);
  -        ctxt.setServletPackageName(pkgName);
  -        ctxt.setServletJavaFileName(javaFileName);
           
           ParseEventListener listener = new JspParseEventListener(ctxt);
           
  
  
  
  1.3.2.1   +8 -9      jakarta-tomcat/src/share/org/apache/jasper/compiler/JspCompiler.java
  
  Index: JspCompiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspCompiler.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- JspCompiler.java	1999/11/13 00:32:47	1.3
  +++ JspCompiler.java	2000/02/04 01:37:14	1.3.2.1
  @@ -272,23 +272,22 @@
           } else  {
               outDated = classFile.lastModified() < jspReal.lastModified();
   	    if (outDated) {
  -                String classNameFromFile = ClassName.getClassName(classFileName);
   		cfd = new ClassFileData(outDated, classFileName, className);
                   cfd.incrementNumber();
  -                
  -                String cn = cfd.getClassName();
  -                int lastDot = cn.lastIndexOf('.');
  -                if (lastDot != -1)
  -                    className = cn.substring(lastDot+1,
  -                                             classNameFromFile.length());
  -                else
  -                    className = cn;
   	    } else {
   		// cn ( Class Name ) is extracted from class data.
   		// If the file is not out-dated, it is not needed, and will
   		// be computed only if someone ask for it.
   		cfd = new ClassFileData(outDated, classFileName, null);
   	    }
  +            String classNameFromFile = ClassName.getClassName(classFileName);
  +            String cn = cfd.getClassName();
  +            int lastDot = cn.lastIndexOf('.');
  +            if (lastDot != -1)
  +                className = cn.substring(lastDot+1,
  +                                         classNameFromFile.length());
  +            else
  +                className = cn;	    
           }
       }
   }
  
  
  
  1.3.2.2   +15 -23    jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java
  
  Index: JspUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- JspUtil.java	1999/12/23 09:29:27	1.3.2.1
  +++ JspUtil.java	2000/02/04 01:37:14	1.3.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v
1.3.2.1 1999/12/23 09:29:27 mode Exp $
  - * $Revision: 1.3.2.1 $
  - * $Date: 1999/12/23 09:29:27 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v
1.3.2.2 2000/02/04 01:37:14 mandar Exp $
  + * $Revision: 1.3.2.2 $
  + * $Date: 2000/02/04 01:37:14 $
    *
    * ====================================================================
    * 
  @@ -88,8 +88,6 @@
   
       private static final String OPEN_EXPR  = "<%=";
       private static final String CLOSE_EXPR = "%>";
  -    private static final String OPEN_EXPR_2	 = "<jsp:expression";
  -    private static final String CLOSE_EXPR_2 = "/>";
   
       public static char[] removeQuotes(char []chars) {
   	CharArrayWriter caw = new CharArrayWriter();
  @@ -107,30 +105,24 @@
   
       // Checks if the token is a runtime expression.
       public static boolean isExpression (String token) {
  -	
  -	if ((token.startsWith(OPEN_EXPR) || token.startsWith(OPEN_EXPR_2)) &&
  -	    (token.endsWith(CLOSE_EXPR) || token.endsWith(CLOSE_EXPR_2)))
  +	if (token.startsWith(OPEN_EXPR) && token.endsWith(CLOSE_EXPR)) {
   	    return true;
  -	return false;
  +	}
  +
  +	return false;	
       }
   
       // Returns the "expression" part -- takin <%= and %> out.
       public static String getExpr (String expression) {
  -	String returnString = "";
  -	
  -	if (expression.startsWith(OPEN_EXPR))
  -	    returnString = expression.substring (OPEN_EXPR.length());
  -	else if (expression.startsWith(OPEN_EXPR_2))
  -	    returnString = expression.substring (OPEN_EXPR_2.length()); 
  +	String returnString;
  +	int length = expression.length();
   	
  -	int length = returnString.length();
  -	if (expression.endsWith(CLOSE_EXPR))
  -	    returnString = returnString.substring (0, length - 
  -	    						CLOSE_EXPR.length());
  -	else if (expression.endsWith(CLOSE_EXPR_2))
  -	    returnString = returnString.substring (0, length - 
  -	    						CLOSE_EXPR_2.length());
  -	
  +	if (expression.startsWith(OPEN_EXPR) && expression.endsWith(CLOSE_EXPR)) {
  +	    returnString = expression.substring (OPEN_EXPR.length(), length - CLOSE_EXPR.length());
  +	} else {
  +	    returnString = "";
  +	}
  +
   	return returnString;
       }
   
  
  
  

Mime
View raw message