Return-Path: Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 81195 invoked by uid 1172); 24 Oct 2000 02:20:51 -0000 Date: 24 Oct 2000 02:20:51 -0000 Message-ID: <20001024022051.81133.qmail@locus.apache.org> From: greenrd@locus.apache.org To: xml-cocoon-cvs@apache.org Subject: cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp XSPProcessor.java greenrd 00/10/23 19:20:50 Modified: . changes.xml todo.xml src/org/apache/cocoon/processor/xsp/language/java XSPJavaProcessor.java src/org/apache/cocoon/processor/xsp/language XSPLanguageProcessor.java src/org/apache/cocoon/processor/xsp XSPProcessor.java Log: Fixed XSPProcessor to pick up correct classpath and compile on Tomcat 3.3 and Catalina Revision Changes Path 1.137 +4 -0 xml-cocoon/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/xml-cocoon/changes.xml,v retrieving revision 1.136 retrieving revision 1.137 diff -u -r1.136 -r1.137 --- changes.xml 2000/10/24 01:51:56 1.136 +++ changes.xml 2000/10/24 02:20:34 1.137 @@ -4,7 +4,7 @@ @@ -17,6 +17,10 @@ + + Fixed XSPProcessor to pick up correct classpath and + compile on Tomcat 3.3 and Catalina (Tomcat 4). + Added WebSphere installation script to docs. 1.39 +4 -3 xml-cocoon/todo.xml Index: todo.xml =================================================================== RCS file: /home/cvs/xml-cocoon/todo.xml,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- todo.xml 2000/10/23 20:30:26 1.38 +++ todo.xml 2000/10/24 02:20:34 1.39 @@ -3,7 +3,7 @@ @@ -16,9 +16,6 @@ - - Apply patch to let XSP compile on Tomcat >3.1 - Make ESQL default to inner-method=false but make this configurable in cocoon.properties. @@ -45,6 +42,10 @@ Make cocoon.properties (i.e. Configurations objects) easily accessible from XSP. + + + Integrate and test Jeremy Quinn's multiline get-nested-content template, + especially for use with <xsp:expr>. Write a full guide to logicsheets, including: (1) What they are and how 1.12 +8 -3 xml-cocoon/src/org/apache/cocoon/processor/xsp/language/java/XSPJavaProcessor.java Index: XSPJavaProcessor.java =================================================================== RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/language/java/XSPJavaProcessor.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- XSPJavaProcessor.java 2000/08/18 22:43:59 1.11 +++ XSPJavaProcessor.java 2000/10/24 02:20:37 1.12 @@ -1,4 +1,4 @@ -/*-- $Id: XSPJavaProcessor.java,v 1.11 2000/08/18 22:43:59 stefano Exp $ -- +/*-- $Id: XSPJavaProcessor.java,v 1.12 2000/10/24 02:20:37 greenrd Exp $ -- ============================================================================ The Apache Software License, Version 1.1 @@ -61,7 +61,7 @@ /** * @author Ricardo Rocha - * @version $Revision: 1.11 $ $Date: 2000/08/18 22:43:59 $ + * @version $Revision: 1.12 $ $Date: 2000/10/24 02:20:37 $ */ public class XSPJavaProcessor implements XSPLanguageProcessor, Configurable { // Create class loader @@ -69,6 +69,7 @@ protected String encoding; protected XSPClassLoader classLoader; protected JavaCompiler javac; + protected String classpath; protected boolean format; @@ -113,6 +114,10 @@ return code; } + public void setClassPath(String classpath) { + this.classpath = classpath; + } + public void compile(String filename) throws Exception { String repositoryName = this.repository.getCanonicalPath(); String fullFilename = repositoryName + File.separator + filename; @@ -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 + classpath); javac.setOutputDir(repositoryName); javac.setMsgOutput(err); 1.6 +4 -2 xml-cocoon/src/org/apache/cocoon/processor/xsp/language/XSPLanguageProcessor.java Index: XSPLanguageProcessor.java =================================================================== RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/language/XSPLanguageProcessor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- XSPLanguageProcessor.java 2000/05/07 00:43:57 1.5 +++ XSPLanguageProcessor.java 2000/10/24 02:20:39 1.6 @@ -1,4 +1,4 @@ -/*-- $Id: XSPLanguageProcessor.java,v 1.5 2000/05/07 00:43:57 ricardo Exp $ -- +/*-- $Id: XSPLanguageProcessor.java,v 1.6 2000/10/24 02:20:39 greenrd Exp $ -- ============================================================================ The Apache Software License, Version 1.1 @@ -59,7 +59,7 @@ /** * @author Ricardo Rocha - * @version $Revision: 1.5 $ $Date: 2000/05/07 00:43:57 $ + * @version $Revision: 1.6 $ $Date: 2000/10/24 02:20:39 $ */ public interface XSPLanguageProcessor { public String getSourceExtension(); @@ -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; 1.26 +16 -2 xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPProcessor.java Index: XSPProcessor.java =================================================================== RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPProcessor.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- XSPProcessor.java 2000/08/18 22:43:15 1.25 +++ XSPProcessor.java 2000/10/24 02:20:48 1.26 @@ -1,4 +1,4 @@ -/*-- $Id: XSPProcessor.java,v 1.25 2000/08/18 22:43:15 stefano Exp $ -- +/*-- $Id: XSPProcessor.java,v 1.26 2000/10/24 02:20:48 greenrd Exp $ -- ============================================================================ The Apache Software License, Version 1.1 @@ -78,7 +78,7 @@ * This class implements the XSP engine. * * @author Ricardo Rocha - * @version $Revision: 1.25 $ $Date: 2000/08/18 22:43:15 $ + * @version $Revision: 1.26 $ $Date: 2000/10/24 02:20:48 $ */ public class XSPProcessor extends AbstractActor implements Processor, Configurable, Status @@ -206,6 +206,19 @@ + ". Make sure you have writing permissions."); } + // Languages other than Java may also need to use the classpath to link to Java code + // Try to get the classpath from catalina or tomcat first; if that fails use the + // standard one. + 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 +228,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: " +