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/servlet JasperLoader.java JspServletWrapper.java
Date Tue, 06 Aug 2002 00:11:37 GMT
luehe       2002/08/05 17:11:37

  Modified:    jasper2/src/share/org/apache/jasper Constants.java
                        JspCompilationContext.java
               jasper2/src/share/org/apache/jasper/compiler
                        TagFileProcessor.java
               jasper2/src/share/org/apache/jasper/servlet
                        JasperLoader.java JspServletWrapper.java
  Log:
  Added tag handler class file directory to URL search path.
  
  Revision  Changes    Path
  1.6       +6 -0      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Constants.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Constants.java	16 Jul 2002 19:30:51 -0000	1.5
  +++ Constants.java	6 Aug 2002 00:11:36 -0000	1.6
  @@ -150,6 +150,12 @@
       public static final String JSP_PACKAGE_NAME = "org.apache.jsp";
   
       /**
  +     * The default package name for tag handlers generated from tag files
  +     */
  +    public static final String TAG_FILE_PACKAGE_NAME
  +	= "org.apache.jsp.tagfile";
  +
  +    /**
        * Servlet context and request attributes that the JSP engine
        * uses. 
        */
  
  
  
  1.15      +7 -5      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java
  
  Index: JspCompilationContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JspCompilationContext.java	3 Aug 2002 23:29:21 -0000	1.14
  +++ JspCompilationContext.java	6 Aug 2002 00:11:36 -0000	1.15
  @@ -115,7 +115,7 @@
       protected boolean reload = true;
       
       protected URLClassLoader jspLoader;
  -    protected URL[] outUrls = new URL[1];
  +    protected URL[] outUrls = new URL[2];
       protected Class servletClass;
   
       protected boolean isTagFile;
  @@ -404,7 +404,8 @@
           }
   
   	if (isTagFile) {
  -	    jspPath = "tagfiles/org/apache/jsp/" + tagInfo.getTagName() + ".java";
  +	    jspPath = "tagfiles/org/apache/jsp/tagfile/"
  +		+ tagInfo.getTagName() + ".java";
   	} else {
   	    String dirName = getJspFile();
   	    int pos = dirName.lastIndexOf('/');
  @@ -600,6 +601,7 @@
               this.outputDir = outDirF.toString() + File.separator;
               
               outUrls[0] = new URL(outDirF.toURL().toString() + File.separator);
  +            outUrls[1] = new URL("file:" + options.getScratchDir() + File.separator + "tagfiles"
+ File.separator);
           } catch (Exception e) {
               throw new IllegalStateException("No output directory: " +
                                               e.getMessage());
  
  
  
  1.10      +3 -3      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java
  
  Index: TagFileProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TagFileProcessor.java	3 Aug 2002 23:29:21 -0000	1.9
  +++ TagFileProcessor.java	6 Aug 2002 00:11:36 -0000	1.10
  @@ -259,7 +259,7 @@
                   bodycontent = TagInfo.BODY_CONTENT_SCRIPTLESS;
               }
   
  -            tagclass = Constants.JSP_PACKAGE_NAME + "." + name;
  +            tagclass = Constants.TAG_FILE_PACKAGE_NAME + "." + name;
   
               TagVariableInfo[] tagVariableInfos
                       = new TagVariableInfo[variableVector.size()];
  
  
  
  1.4       +17 -12    jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JasperLoader.java
  
  Index: JasperLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JasperLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JasperLoader.java	14 Jun 2002 20:47:01 -0000	1.3
  +++ JasperLoader.java	6 Aug 2002 00:11:36 -0000	1.4
  @@ -201,24 +201,29 @@
   	}
   
   	// Only load classes for this JSP page
  -	if( name.startsWith(className) ) {
  -	    String classFile = name.substring(Constants.JSP_PACKAGE_NAME.length()+1) +
  -		".class";
  -	    byte [] cdata = loadClassDataFromFile(classFile);
  -	    if( cdata == null )
  +	// (including tag handlers generated from tag files)
  +	if (name.startsWith(className)) {
  +	    String classFile
  +		= name.substring(Constants.JSP_PACKAGE_NAME.length() + 1)
  +		+ ".class";
  +	    byte[] cdata = loadClassDataFromFile(classFile);
  +	    if (cdata == null) {
   		throw new ClassNotFoundException(name);
  -	    if( System.getSecurityManager() != null ) {
  -		ProtectionDomain pd = new ProtectionDomain(
  -			codeSource,permissionCollection);
  -		clazz = defineClass(name,cdata,0,cdata.length,pd);
  +	    }
  +	    if (System.getSecurityManager() != null) {
  +		ProtectionDomain pd
  +		    = new ProtectionDomain(codeSource, permissionCollection);
  +		clazz = defineClass(name, cdata, 0, cdata.length, pd);
   	    } else {
  -		clazz = defineClass(name,cdata,0,cdata.length);
  +		clazz = defineClass(name, cdata, 0, cdata.length);
   	    }
  -	    if( clazz != null ) {
  -		if( resolve )                
  +	    if (clazz != null) {
  +		if (resolve)                
   		    resolveClass(clazz);
   		return clazz;
   	    }
  +	} else if (name.startsWith(Constants.TAG_FILE_PACKAGE_NAME)) {
  +	    return findClass(name);
   	}
   
   	throw new ClassNotFoundException(name);
  
  
  
  1.12      +5 -5      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java
  
  Index: JspServletWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JspServletWrapper.java	3 Aug 2002 23:29:21 -0000	1.11
  +++ JspServletWrapper.java	6 Aug 2002 00:11:36 -0000	1.12
  @@ -148,10 +148,10 @@
   	// path
   	String standard = null;
   	if (tagFilePath.indexOf('/') != -1) {
  -	    standard = "/tagfiles/org/apache/jsp/"
  +	    standard = "/tagfiles/org/apache/jsp/tagfile/"
   		+ tagFilePath.substring(tagFilePath.lastIndexOf("/") + 1);
   	} else {
  -	    standard = "/tagfiles/org/apache/jsp/" + tagFilePath;
  +	    standard = "/tagfiles/org/apache/jsp/tagfile/" + tagFilePath;
   	}
           ctxt.createOutdir(standard);
       }
  
  
  

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