Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 85268 invoked from network); 9 Oct 2000 08:33:01 -0000 Received: from unknown (HELO ?195.115.98.1?) (195.115.98.1) by locus.apache.org with SMTP; 9 Oct 2000 08:33:01 -0000 Received: from maileu.imediation.com by [195.115.98.1] via smtpd (for locus.apache.org [63.211.145.10]) with SMTP; 9 Oct 2000 09:33:07 UT Received: (private information removed) Message-ID: <9B3E950CB293D411ADF4009027B0A4D2093A4C@maileu.imediation.com> From: Sebastien Sahuc To: cocoon-dev@xml.apache.org Subject: RE: [Patch] allows xsp to compile under catalina & tomcat 3.3 Date: Mon, 9 Oct 2000 09:32:58 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="windows-1252" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N > > I thought Stefano took care of it a couple of weeks ago, Indeed he did for Cocoon2, whereas the submitted patch is Cocoon1 targeted ! Sebastien > but hey, > thanks! We're trying to fix the problems with a more decent solution, > but it's mostly a JavaC issue, neither Cocoon's or Tomcat/Catalina... > > Stay tuned... > > Pier > > Paul Lamb wrote: > > > > This allows the xsp compiler to use the classpath exposed > by the latest > > catalina or tomcat. I can't say that I really like this, > but there doesn't > > seem to be an alternative. > > > > Paul Lamb > > > > Index: > xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPProcessor.java > > =================================================================== > > RCS file: > > > /home/cvspublic/xml-cocoon/src/org/apache/cocoon/processor/xsp > /XSPProcessor. > > java,v > > retrieving revision 1.25 > > diff -u -r1.25 XSPProcessor.java > > --- xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPProcessor.java > > 2000/08/18 22:43:15 1.25 > > +++ xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPProcessor.java > > 2000/10/09 03:16:53 > > @@ -206,6 +206,15 @@ > > + ". Make sure you have writing permissions."); > > } > > > > + String classpath = (String) > > > this.servletContext.getAttribute("org.apache.catalina.jsp_classpath"); > > + if (classpath == null) { > > + classpath = (String) > > this.servletContext.getAttribute("org.apache.tomcat.jsp_classpath"); > > + } > > + if( classpath == null ) { > > + classpath = System.getProperty("java.class.path"); > > + } > > + > > + > > // Set repository for each language processor > > Enumeration enum = this.languages.elements(); > > while (enum.hasMoreElements()) { > > @@ -215,6 +224,7 @@ > > try { > > languageProcessor.setEncoding(this.encoding); > > languageProcessor.setRepository(this.repositoryFile); > > + languageProcessor.setClassPath(classpath); > > } catch (Exception e) { > > throw new RuntimeException( > > "Error setting repository for language processor: " + > > > > Index: > > > xml-cocoon/src/org/apache/cocoon/processor/xsp/language/XSPLan > guageProcessor > > .java > > =================================================================== > > RCS file: > > > /home/cvspublic/xml-cocoon/src/org/apache/cocoon/processor/xsp > /language/XSPL > > anguageProcessor.java,v > > retrieving revision 1.5 > > diff -u -r1.5 XSPLanguageProcessor.java > > --- > > > xml-cocoon/src/org/apache/cocoon/processor/xsp/language/XSPLan > guageProcessor > > .java 2000/05/07 00:43:57 1.5 > > +++ > > > xml-cocoon/src/org/apache/cocoon/processor/xsp/language/XSPLan > guageProcessor > > .java 2000/10/09 03:16:54 > > @@ -52,8 +52,8 @@ > > package org.apache.cocoon.processor.xsp.language; > > > > import java.io.File; > > -import org.w3c.dom.Document; > > -import javax.servlet.http.HttpServletRequest; > > +//import org.w3c.dom.Document; > > +//import javax.servlet.http.HttpServletRequest; > > > > import org.apache.cocoon.processor.xsp.*; > > > > @@ -70,6 +70,8 @@ > > > > public void setFormatOption(boolean format); > > public String formatCode(String code) throws Exception; > > + > > + public void setClassPath(String classpath); > > > > public void compile(String filename) throws Exception; > > > > > > Index: > > > xml-cocoon/src/org/apache/cocoon/processor/xsp/language/java/X > SPJavaProcesso > > r.java > > =================================================================== > > RCS file: > > > /home/cvspublic/xml-cocoon/src/org/apache/cocoon/processor/xsp > /language/java > > /XSPJavaProcessor.java,v > > retrieving revision 1.11 > > diff -u -r1.11 XSPJavaProcessor.java > > --- > > > xml-cocoon/src/org/apache/cocoon/processor/xsp/language/java/X > SPJavaProcesso > > r.java 2000/08/18 22:43:59 1.11 > > +++ > > > xml-cocoon/src/org/apache/cocoon/processor/xsp/language/java/X > SPJavaProcesso > > r.java 2000/10/09 03:16:54 > > @@ -69,6 +69,7 @@ > > protected String encoding; > > protected XSPClassLoader classLoader; > > protected JavaCompiler javac; > > + protected String classpath; > > > > protected boolean format; > > > > @@ -112,6 +113,10 @@ > > // or similar to allow easier XSP code debugging (SM) > > return code; > > } > > + > > + public void setClassPath(String classpath) { > > + this.classpath = classpath; > > + } > > > > public void compile(String filename) throws Exception { > > String repositoryName = this.repository.getCanonicalPath(); > > @@ -120,7 +125,7 @@ > > ByteArrayOutputStream err = new ByteArrayOutputStream(256); > > > > javac.setEncoding(this.encoding); > > - javac.setClasspath(repositoryName + File.pathSeparator + > > System.getProperty("java.class.path")); > > + javac.setClasspath(repositoryName + File.pathSeparator + > > this.classpath); > > javac.setOutputDir(repositoryName); > > javac.setMsgOutput(err); > > >