cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r737817 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
Date Mon, 26 Jan 2009 20:24:28 GMT
Author: dkulp
Date: Mon Jan 26 20:24:28 2009
New Revision: 737817

URL: http://svn.apache.org/viewvc?rev=737817&view=rev
Log:
Find longest matching path for rest based stuff

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java?rev=737817&r1=737816&r2=737817&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
Mon Jan 26 20:24:28 2009
@@ -183,12 +183,16 @@
         
         String address = request.getPathInfo() == null ? "" : request.getPathInfo();
         
+        int len = -1;
+        ServletDestination ret = null;
         for (String path : transport.getDestinationsPaths()) {           
-            if (address.startsWith(path)) {                
-                return transport.getDestinationForPath(path);
+            if (address.startsWith(path)
+                && path.length() > len) {
+                ret = transport.getDestinationForPath(path);
+                len = path.length();
             }
         }
-        return null; 
+        return ret; 
     }
     
     protected void generateServiceList(HttpServletRequest request, HttpServletResponse response)



Mime
View raw message