You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2008/04/24 09:13:17 UTC

svn commit: r651176 - /cocoon/whiteboard/corona/trunk/corona-servlet/src/main/java/org/apache/cocoon/corona/servlet/SitemapServlet.java

Author: reinhard
Date: Thu Apr 24 00:13:10 2008
New Revision: 651176

URL: http://svn.apache.org/viewvc?rev=651176&view=rev
Log:
remove the context path and the servlet path from the URI passed to the sitemap interpreter

Modified:
    cocoon/whiteboard/corona/trunk/corona-servlet/src/main/java/org/apache/cocoon/corona/servlet/SitemapServlet.java

Modified: cocoon/whiteboard/corona/trunk/corona-servlet/src/main/java/org/apache/cocoon/corona/servlet/SitemapServlet.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-servlet/src/main/java/org/apache/cocoon/corona/servlet/SitemapServlet.java?rev=651176&r1=651175&r2=651176&view=diff
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-servlet/src/main/java/org/apache/cocoon/corona/servlet/SitemapServlet.java (original)
+++ cocoon/whiteboard/corona/trunk/corona-servlet/src/main/java/org/apache/cocoon/corona/servlet/SitemapServlet.java Thu Apr 24 00:13:10 2008
@@ -91,7 +91,7 @@
             HttpContextHelper.storeResponse(response, parameters);
 
             ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
-            this.invoke(request.getRequestURI(), parameters, baos);
+            this.invoke(this.calcSitemapRequestURI(request), parameters, baos);
 
             response.setContentType(MimeTypeCollector.getMimeType());
             response.setContentLength(baos.size());
@@ -124,6 +124,12 @@
         } catch (MalformedURLException e) {
             throw new RuntimeException(e);
         }
+    }
+
+    private String calcSitemapRequestURI(HttpServletRequest request) {
+        String contextPath = request.getContextPath();
+        String mountPath = request.getServletPath();
+        return request.getRequestURI().substring(contextPath.length() + mountPath.length());
     }
 
     private synchronized void lazyInitialize(ServletConfig servletConfig) throws ServletException {