You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by st...@locus.apache.org on 2000/03/01 17:09:26 UTC
cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp XSPProcessor.java
stefano 00/03/01 08:09:25
Modified: src/org/apache/cocoon/processor/xsp XSPProcessor.java
Log:
fixed problem with loading external taglibs... the URL handling code was broken
Revision Changes Path
1.11 +20 -9 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.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- XSPProcessor.java 2000/02/13 18:29:34 1.10
+++ XSPProcessor.java 2000/03/01 16:09:25 1.11
@@ -1,4 +1,4 @@
-/*-- $Id: XSPProcessor.java,v 1.10 2000/02/13 18:29:34 stefano Exp $ --
+/*-- $Id: XSPProcessor.java,v 1.11 2000/03/01 16:09:25 stefano Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -72,7 +72,7 @@
* This class implements the XSP engine.
*
* @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
- * @version $Revision: 1.10 $ $Date: 2000/02/13 18:29:34 $
+ * @version $Revision: 1.11 $ $Date: 2000/03/01 16:09:25 $
*/
public class XSPProcessor extends AbstractActor
implements Processor, Configurable, Status
@@ -192,13 +192,13 @@
// Initialize repository
conf = conf.getConfigurations("xsp");
-
+
/* How to use Cocoon's Object Store for compiled classes? */
// FIXME: the XSP processor should use the Cocoon internal object store
- // rather than providing its own. This is a quick and dirty hack to
+ // rather than providing its own. This is a quick and dirty hack to
// make it work with Ricardo's code. But we'll create smoother integration
// in future versions (SM)
-
+
String repositoryName = (String) conf.get("repository");
this.repositoryFile = new File(repositoryName);
if (!this.repositoryFile.exists()) {
@@ -260,11 +260,22 @@
try {
InputStream stream;
+
+ if (location.indexOf("://") > -1) {
+ URL url;
- if (location.startsWith("resource://")) {
- URL x = ClassLoader.getSystemResource(location.substring("resource://".length()));
- if (x == null) throw new IOException("Resource not found: " + location);
- else stream = x.openStream();
+ if (location.startsWith("resource://")) {
+ // this to avoid the portability issues with the URLHandling factories
+ url = ClassLoader.getSystemResource(location.substring("resource://".length()));
+ } else {
+ url = new URL(location);
+ }
+
+ if (url == null) {
+ throw new IOException("Resource not found: " + location);
+ } else {
+ stream = url.openStream();
+ }
} else {
stream = new FileInputStream(location);
}