[jbossws-commits] JBossWS SVN: r9228 - stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf.
jbossws-commits at lists.jboss.org
jbossws-commits at lists.jboss.org
Wed Feb 4 04:46:09 EST 2009
Author: richard.opalka at jboss.com
Date: 2009-02-04 04:46:09 -0500 (Wed, 04 Feb 2009)
New Revision: 9228
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
Log:
[JBWS-2512] fallback only if there's no exact match
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2009-02-03 18:59:10 UTC (rev 9227)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2009-02-04 09:46:09 UTC (rev 9228)
@@ -70,17 +70,21 @@
// Find destination based on request URI
String requestURI = req.getRequestURI();
Collection<ServletDestination> destinations = cxfTransport.getDestinations();
+ String exactMatch = null;
+ ServletDestination returnValue = null;
for (ServletDestination destination : destinations)
{
EndpointInfo endpointInfo = destination.getEndpointInfo();
String address = endpointInfo.getAddress();
// Fix invalid leading slash
+ /*
if (address.startsWith("/http://"))
{
address = address.substring(1);
endpointInfo.setAddress(address);
}
+ */
String path = address;
try
@@ -92,13 +96,20 @@
// ignore
}
- if (requestURI.startsWith(path))
+ if (requestURI.equals(path))
{
- return destination;
+ return destination; // exact match
}
+ else if (requestURI.startsWith(path))
+ {
+ returnValue = destination; // fallback
+ }
}
- throw new ServletException("Cannot obtain destination for: " + requestURI);
+ if (returnValue == null)
+ throw new ServletException("Cannot obtain destination for: " + requestURI);
+
+ return returnValue;
}
/**
More information about the jbossws-commits
mailing list