You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gk...@apache.org on 2007/06/07 00:48:05 UTC

svn commit: r544980 - /cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java

Author: gkossakowski
Date: Wed Jun  6 15:48:04 2007
New Revision: 544980

URL: http://svn.apache.org/viewvc?view=rev&rev=544980
Log:
COCOON-2066: Reverting temporary fix (comitted in r544460) as discussed here:
http://thread.gmane.org/gmane.text.xml.cocoon.cvs/24573/focus=73530

Modified:
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java?view=diff&rev=544980&r1=544979&r2=544980
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java Wed Jun  6 15:48:04 2007
@@ -54,9 +54,6 @@
     /** The servlet collector bean */
     private Map blockServletCollector;
 
-    /** Holds the mount prefix of the current request accessible by {@link DispatcherServlet.getDispatcherMountPrefix} */
-    private static ThreadLocal prefix = new ThreadLocal();
-    
     public void init() throws ServletException {
         this.log("Block dispatcher was initialized successfully.");        
     }
@@ -78,7 +75,7 @@
             throw new ServletException("No block for " + req.getPathInfo());
         }
         // Create a dynamic proxy class that overwrites the getServletPath and
-        // getPathInfo methods to provide reasonable values in the called servlet
+        // getPathInfo methods to privide reasonable values in the called servlet
         // the dynamic proxy implements all interfaces of the original request
         HttpServletRequest request = (HttpServletRequest) Proxy.newProxyInstance(
         		req.getClass().getClassLoader(), 
@@ -92,13 +89,7 @@
 	                " pathInfo=" + request.getPathInfo());
         }
         
-        prefix.set(req.getServletPath());
-        try {
-            servlet.service(request, res);
-        }
-        finally {
-            prefix.remove();
-        }
+        servlet.service(request, res);
     }
     
     private void getInterfaces(Set interfaces, Class clazz) {
@@ -124,16 +115,13 @@
 		return (Class[]) interfaces.toArray(new Class[interfaces.size()]);
 	}
 
-    public Map getBlockServletMap() {
+    public Map getBlockServletMap()
+    {
         if(this.blockServletCollector == null) {
             final ApplicationContext applicationContext =
                 WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());
             this.blockServletCollector = (Map)applicationContext.getBean( "org.apache.cocoon.servletservice.spring.BlockServletMap" );
         }
         return blockServletCollector;
-    }
-    
-    public static String getDispatcherMountPrefix() {
-        return prefix.get().toString();
     }
 }