cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dani...@apache.org
Subject svn commit: r349734 - /cocoon/trunk/src/java/org/apache/cocoon/components/blocks/BlockContext.java
Date Tue, 29 Nov 2005 15:35:29 GMT
Author: danielf
Date: Tue Nov 29 07:35:23 2005
New Revision: 349734

URL: http://svn.apache.org/viewcvs?rev=349734&view=rev
Log:
Made the context protocol working in blocks mode. Now the webapp without any blocks works
in blocks mode. Test with ./cocoon.sh blocks.

Modified:
    cocoon/trunk/src/java/org/apache/cocoon/components/blocks/BlockContext.java

Modified: cocoon/trunk/src/java/org/apache/cocoon/components/blocks/BlockContext.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/blocks/BlockContext.java?rev=349734&r1=349733&r2=349734&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/blocks/BlockContext.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/blocks/BlockContext.java Tue Nov 29
07:35:23 2005
@@ -80,6 +80,11 @@
      * @see org.apache.cocoon.environment.Context#getResource(java.lang.String)
      */
     public URL getResource(String path) throws MalformedURLException {
+        // A path starting with '/' should be resolved relative to the context and
+        // the '/' need to be removed to work with the URI resolver.
+        while (path.length() >= 1 && path.charAt(0) == '/') {
+            path = path.substring(1);
+        }
         String contextURL = this.wiring.getContextURL().toExternalForm();
         URL resolvedURL = null;
         try {



Mime
View raw message