cziegeler    2004/03/03 04:38:25

  Modified:    src/java/org/apache/cocoon/matching MountTableMatcher.java
  Log:
  Add an ending slash to the prefix
  
  Revision  Changes    Path
  1.6       +9 -2      
cocoon-2.1/src/java/org/apache/cocoon/matching/MountTableMatcher.java
  
  Index: MountTableMatcher.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/matching/MountTableMatcher.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MountTableMatcher.java    10 Feb 2004 14:45:15 -0000      1.5
  +++ MountTableMatcher.java    3 Mar 2004 12:38:25 -0000       1.6
  @@ -171,7 +171,14 @@
           for (int i = 0; i < children.length; i++) {
               Configuration child = children[i];
               if ("mount".equals(child.getName())) {
  -                mounts.put(children[i].getAttribute("uri-prefix"), 
children[i].getAttribute("src"));
  +                String prefix = children[i].getAttribute("uri-prefix");
  +                // Append a '/' at the end of the prefix
  +                // this avoids flat uri matching which would cause
  +                // exceptions in the sub sitemap!
  +                if (!prefix.endsWith("/")) {
  +                    prefix = prefix + '/';
  +                }
  +                mounts.put(prefix, children[i].getAttribute("src"));
               } else {
                   throw new PatternException(
                       "Unexpected element '" + child.getName() + "' (awaiting 
'mount'), at " + child.getLocation());
  
  
  

Reply via email to