Author: limpbizkit
Date: Wed May 13 13:34:06 2009
New Revision: 944

Modified:
    trunk/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java
    trunk/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java

Log:
Applying the servlet fixes from r840 (on the snapshot) to trunk.

Modified:  
trunk/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java
==============================================================================
--- trunk/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java      
 
(original)
+++ trunk/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java      
 
Wed May 13 13:34:06 2009
@@ -141,6 +141,13 @@

      HttpServletRequest request = (HttpServletRequest) servletRequest;

+    // don't wrap the request if there are no servlets mapped. This  
prevents us from inserting our
+    // wrapper unless it's actually going to be used. This is necessary  
for compatibility for apps
+    // that downcast their HttpServletRequests to a concrete  
implementation.
+    if (!servletPipeline.hasServletsMapped()) {
+      return servletRequest;
+    }
+
      //noinspection OverlyComplexAnonymousInnerClass
      return new HttpServletRequestWrapper(request) {


Modified:  
trunk/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java
==============================================================================
--- trunk/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java     
 
(original)
+++ trunk/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java     
 
Wed May 13 13:34:06 2009
@@ -53,6 +53,10 @@
      this.servletDefinitions =  
Collections.unmodifiableList(collectServletDefinitions(injector));
    }

+  boolean hasServletsMapped() {
+    return !servletDefinitions.isEmpty();
+  }
+
    /**
     * Introspects the injector and collects all instances of bound {...@code  
List<ServletDefinition>}
     * into a master list.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to