User: starksm
Date: 02/02/15 10:06:00
Modified: catalina/src/main/org/jboss/web/catalina
EmbeddedCatalinaServiceSX.java
EmbeddedCatalinaServiceSXMBean.java
Log:
Fix the JSP compiler classpath.
Revision Changes Path
1.5 +49 -3
contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java
Index: EmbeddedCatalinaServiceSX.java
===================================================================
RCS file:
/cvsroot/jboss/contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- EmbeddedCatalinaServiceSX.java 11 Feb 2002 23:03:35 -0000 1.4
+++ EmbeddedCatalinaServiceSX.java 15 Feb 2002 18:06:00 -0000 1.5
@@ -16,6 +16,7 @@
import java.net.MalformedURLException;
import java.net.InetAddress;
import java.security.ProtectionDomain;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import javax.naming.InitialContext;
@@ -49,6 +50,7 @@
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.Loader;
import org.apache.catalina.Logger;
import org.apache.catalina.Realm;
import org.apache.catalina.Valve;
@@ -58,7 +60,6 @@
import org.apache.catalina.connector.warp.WarpHost;
import org.apache.catalina.connector.warp.WarpEngine;
import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.loader.WebappClassLoader;
import org.apache.catalina.startup.Embedded;
/** An implementation of the AbstractWebContainer for the Jakarta Tomcat
@@ -69,7 +70,7 @@
@see org.apache.catalina.startup.Embedded
@author [EMAIL PROTECTED]
- @version $Revision: 1.4 $
+ @version $Revision: 1.5 $
*/
public class EmbeddedCatalinaServiceSX extends AbstractWebContainer implements
EmbeddedCatalinaServiceSXMBean
{
@@ -117,7 +118,7 @@
/** Get the Catalina home directory
*/
- public String GetCatalinaHome()
+ public String getCatalinaHome()
{
return catalinaHome;
}
@@ -269,6 +270,44 @@
}
}
+ /** Build an array of URL strings that will be used as the JSP compiler
+ *classpath. As of Tomcat-4.0.2, this information is not being obtained
+ *from the thread context classloader so we have to build it.
+ */
+ protected String[] getCompileClasspath(ClassLoader loader)
+ {
+ String[] jspResources = {
+ "javax/servlet/resources/web-app_2_3.dtd",
+ "org/apache/jasper/resources/jsp12.dtd",
+ "javax/ejb/EJBHome.class"
+ };
+ ArrayList tmp = new ArrayList();
+ for(int j = 0; j < jspResources.length; j ++)
+ {
+ URL rsrcURL = loader.getResource(jspResources[j]);
+ if( rsrcURL != null )
+ {
+ String url = rsrcURL.toExternalForm();
+ if( rsrcURL.getProtocol().equals("jar") )
+ {
+ // Parse the jar:<url>!/{entry} URL
+ url = url.substring(4);
+ int seperator = url.indexOf('!');
+ url = url.substring(0, seperator);
+ }
+ tmp.add(url);
+ }
+ else
+ {
+ log.warn("Failed to fin jsp rsrc: "+jspResources[j]);
+ }
+ }
+ log.debug("JSP CompileClasspath: " + tmp);
+ String[] cp = new String[tmp.size()];
+ tmp.toArray(cp);
+ return cp;
+ }
+
/** Perform the tomcat specific deployment steps.
*/
protected WebApplication performDeploy(String ctxPath, String warUrl,
@@ -479,6 +518,13 @@
}
}
+ ClassLoader rsrcLoader = Thread.currentThread().getContextClassLoader();
+ String[] jspCP = getCompileClasspath(rsrcLoader);
+ Loader ctxLoader = context.getLoader();
+ for(int u = 0; u < jspCP.length; u ++)
+ {
+ ctxLoader.addRepository(jspCP[u]);
+ }
// Apply any extended configuration to the context
// Get the web-app.xml and jboss-web.xml deployment descriptors
1.3 +2 -2
contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSXMBean.java
Index: EmbeddedCatalinaServiceSXMBean.java
===================================================================
RCS file:
/cvsroot/jboss/contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSXMBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EmbeddedCatalinaServiceSXMBean.java 11 Feb 2002 23:03:37 -0000 1.2
+++ EmbeddedCatalinaServiceSXMBean.java 15 Feb 2002 18:06:00 -0000 1.3
@@ -16,13 +16,13 @@
/** Management interface for the embedded Catalina service.
*
* @author [EMAIL PROTECTED]
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public interface EmbeddedCatalinaServiceSXMBean extends AbstractWebContainerMBean
{
/** Get the Catalina home directory
*/
- public String GetCatalinaHome();
+ public String getCatalinaHome();
/** Set the Catalina home directory
*/
public void setCatalinaHome(String homePath);
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development