larryi 01/06/11 04:36:09
Modified: src/share/org/apache/tomcat/startup Main.java
Log:
Add handling to set the "tc_path_add" system property to include web
application classpath entries. This is used by Jasper's JspServlet.
Revision Changes Path
1.34 +29 -4 jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
Index: Main.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- Main.java 2001/06/09 03:35:06 1.33
+++ Main.java 2001/06/11 11:36:06 1.34
@@ -1,4 +1,4 @@
-/* $Id: Main.java,v 1.33 2001/06/09 03:35:06 costin Exp $
+/* $Id: Main.java,v 1.34 2001/06/11 11:36:06 larryi Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@@ -109,7 +109,7 @@
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
- @version $Revision: 1.33 $ $Date: 2001/06/09 03:35:06 $
+ @version $Revision: 1.34 $ $Date: 2001/06/11 11:36:06 $
*/
public class Main{
@@ -254,6 +254,7 @@
getCommonDir());
IntrospectionUtils.addJarsFromClassPath(commonJars,
TOMCAT_COMMON_CLASSPATH);
+ addToTomcatClasspathSysProp(commonJars);
URL[] commonClassPath=IntrospectionUtils.getClassPath(commonJars);
// displayClassPath( "common ", commonClassPath );
@@ -279,8 +280,8 @@
IntrospectionUtils.addToClassPath(appsJars, getAppsDir());
IntrospectionUtils.addJarsFromClassPath( appsJars,
TOMCAT_APPS_CLASSPATH);
+ addToTomcatClasspathSysProp(appsJars);
-
URL[] appsClassPath=IntrospectionUtils.getClassPath(appsJars);
ClassLoader appsCl=
jdk11Compat.newClassLoaderInstance(appsClassPath ,
@@ -314,7 +315,31 @@
System.out.println( cp[i].getFile() );
}
}
-
+
+ /**
+ * Adds classpath entries from a vector of URL's to the
+ * "tc_path_add" System property. This System property lists
+ * the classpath entries common to web applications. This System
+ * property is currently used by Jasper when its JSP servlet
+ * compiles the Java file for a JSP.
+ */
+
+ private void addToTomcatClasspathSysProp(Vector v)
+ {
+ String sep = System.getProperty("path.separator");
+ String cp = System.getProperty("tc_path_add");
+
+ Enumeration e = v.elements();
+ while( e.hasMoreElements() ) {
+ URL url = (URL)e.nextElement();
+ if( cp != null)
+ cp += sep + url.getFile();
+ else
+ cp = url.getFile();
+ }
+ if( cp != null)
+ System.setProperty("tc_path_add",cp);
+ }
}