stefano 00/09/18 17:28:50
Modified: src/org/apache/cocoon/servlet Tag: xml-cocoon2
CocoonServlet.java
Log:
get the classpath from a special catalina attribute (like Jasper does) It's a
big hack, but now FINALLY, everything works like it should, so just drop the
big war file and you're done
Revision Changes Path
No revision
No revision
1.1.4.19 +20 -3
xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java
Index: CocoonServlet.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java,v
retrieving revision 1.1.4.18
retrieving revision 1.1.4.19
diff -u -r1.1.4.18 -r1.1.4.19
--- CocoonServlet.java 2000/08/31 16:00:53 1.1.4.18
+++ CocoonServlet.java 2000/09/19 00:28:49 1.1.4.19
@@ -40,16 +40,19 @@
* (Apache Software Foundation, Exoffice Technologies)
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Nicola Ken Barozzi</a> Aisa
- * @version CVS $Revision: 1.1.4.18 $ $Date: 2000/08/31 16:00:53 $
+ * @version CVS $Revision: 1.1.4.19 $ $Date: 2000/09/19 00:28:49 $
*/
public class CocoonServlet extends HttpServlet {
- private Cocoon cocoon = null;
+ public static final String SERVLET_CLASSPATH =
"org.apache.catalina.jsp_classpath";
+
private long creationTime = 0;
+ private Cocoon cocoon = null;
private String configurationFile = null;
private Exception exception = null;
private ServletContext context = null;
+ private String classpath = null;
/**
* Initialize this <code>CocoonServlet</code> instance.
@@ -60,6 +63,20 @@
this.context = conf.getServletContext();
+ // WARNING (SM): the line below BREAKS the Servlet API compatibility
+ // This is a hack to go around java compiler design problems that
+ // do not allow applications to force their own classloader to the
+ // compiler during compilation.
+ // We look for a specific Tomcat attribute so we are bound to Tomcat
+ // this means Cocoon won't be able to compile things if the necessary
+ // classes are not already present in the *SYSTEM* classpath, any
other
+ // container classloading will break it on other servlet containers.
+ // To fix this, Javac must be redesigned and rewritten or we have to
+ // write our own compiler.
+ // For now we tie ourselves to Tomcat but at least we can work
without
+ // placing everything in the system classpath.
+ this.classpath = (String) context.getAttribute(SERVLET_CLASSPATH);
+
String configFile = conf.getInitParameter("configurations");
this.context.log("this.configurationFile: " + configFile);
@@ -278,7 +295,7 @@
try {
this.context.log("Reloading from: " + this.configurationFile);
- Cocoon c = new Cocoon(this.configurationFile);
+ Cocoon c = new Cocoon(this.configurationFile, this.classpath);
this.creationTime = System.currentTimeMillis();