cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r422648 - in /cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing: MountableProcessor.java impl/MountTableProcessorImpl.java sitemap/impl/SitemapProcessor.java
Date Mon, 17 Jul 2006 07:33:44 GMT
Author: cziegeler
Date: Mon Jul 17 00:33:44 2006
New Revision: 422648

URL: http://svn.apache.org/viewvc?rev=422648&view=rev
Log:
Update

Modified:
    cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/MountableProcessor.java
    cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/impl/MountTableProcessorImpl.java
    cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/sitemap/impl/SitemapProcessor.java

Modified: cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/MountableProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/MountableProcessor.java?rev=422648&r1=422647&r2=422648&view=diff
==============================================================================
--- cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/MountableProcessor.java
(original)
+++ cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/MountableProcessor.java
Mon Jul 17 00:33:44 2006
@@ -24,5 +24,4 @@
 
     String getMountUri();
 
-    boolean stripPrefix();
 }

Modified: cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/impl/MountTableProcessorImpl.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/impl/MountTableProcessorImpl.java?rev=422648&r1=422647&r2=422648&view=diff
==============================================================================
--- cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/impl/MountTableProcessorImpl.java
(original)
+++ cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/impl/MountTableProcessorImpl.java
Mon Jul 17 00:33:44 2006
@@ -100,11 +100,7 @@
                 // check for '/' following the prefix, otherwise we don't match
                 if ( uri.charAt(entry.getMountUri().length()) == '/' ) {
                     // ok, now we are sure
-                    HttpServletRequest req = request;
-                    if ( entry.stripPrefix() ) {
-                        req = RequestUtil.createRequestForUri(request, entry.getMountUri(),
uri.substring(entry.getMountUri().length()+1));
-                    }
-                    return entry.process(req, response);
+                   return entry.process(request, response);
                 }
             }
         }

Modified: cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/sitemap/impl/SitemapProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/sitemap/impl/SitemapProcessor.java?rev=422648&r1=422647&r2=422648&view=diff
==============================================================================
--- cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/sitemap/impl/SitemapProcessor.java
(original)
+++ cocoon/whiteboard/processor/src/main/java/org/apache/cocoon/processing/sitemap/impl/SitemapProcessor.java
Mon Jul 17 00:33:44 2006
@@ -28,9 +28,10 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.ProcessingUtil;
 import org.apache.cocoon.components.treeprocessor.TreeProcessor;
+import org.apache.cocoon.processing.MountableProcessor;
 import org.apache.cocoon.processing.ProcessingException;
-import org.apache.cocoon.processing.Processor;
 import org.apache.cocoon.servlet.RequestProcessor;
+import org.apache.cocoon.servlet.RequestUtil;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.springframework.beans.BeansException;
@@ -46,7 +47,7 @@
  * @since 2.2
  */
 public class SitemapProcessor 
-    implements Processor,
+    implements MountableProcessor,
                BeanFactoryAware,
                DisposableBean,
                ServletContextAware {
@@ -70,6 +71,8 @@
 
     protected TreeProcessor treeProcessor;
 
+    protected boolean stripPrefix = true;
+
     public void setSourceResolver(SourceResolver resolver) {
         this.resolver = resolver;
     }
@@ -162,11 +165,22 @@
     public boolean process(HttpServletRequest request, HttpServletResponse response)
     throws ProcessingException, IOException, SAXException {
         this.createSitemapProcessor();
+        HttpServletRequest req = request;
+        if ( this.stripPrefix ) {
+            req = RequestUtil.createRequestByRemovingPrefixFromUri(request, this.uriPrefix);
           
+        }
         try {
-             this.requestProcessor.service(request, response);
+             this.requestProcessor.service(req, response);
         } catch (ServletException se) {
             throw new ProcessingException(se);
         }
         return true;
+    }
+
+    /**
+     * @see org.apache.cocoon.processing.MountableProcessor#getMountUri()
+     */
+    public String getMountUri() {
+        return this.uriPrefix;
     }
 }



Mime
View raw message