cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1004334 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java
Date Mon, 04 Oct 2010 17:52:54 GMT
Author: sergeyb
Date: Mon Oct  4 17:52:54 2010
New Revision: 1004334

URL: http://svn.apache.org/viewvc?rev=1004334&view=rev
Log:
Updating ServletDestination to return a proper base address in case of destination address
being overwritten

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

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java?rev=1004334&r1=1004333&r2=1004334&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java
Mon Oct  4 17:52:54 2010
@@ -20,6 +20,7 @@
 package org.apache.cxf.transport.servlet;
 
 import java.io.IOException;
+import java.net.URI;
 import java.util.logging.Logger;
 
 import javax.servlet.ServletConfig;
@@ -97,7 +98,13 @@ public class ServletDestination extends 
  
     }
     protected String getBasePath(String contextPath) throws IOException {
-        return contextPath + getAddress().getAddress().getValue();
+        
+        String address = getAddress().getAddress().getValue();
+        if (address.startsWith("http")) {
+            return URI.create(address).getPath();
+        }
+        
+        return contextPath + address;
     }
     
     @Override



Mime
View raw message