Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CD51B17739 for ; Fri, 20 Mar 2015 23:08:35 +0000 (UTC) Received: (qmail 39490 invoked by uid 500); 20 Mar 2015 23:08:35 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 39412 invoked by uid 500); 20 Mar 2015 23:08:35 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 39402 invoked by uid 99); 20 Mar 2015 23:08:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Mar 2015 23:08:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 93837E112F; Fri, 20 Mar 2015 23:08:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: <314af2c23b3240c6a5607c151c598ec8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: [CXF-6302] Initial support for URL-encoded RS destinations Date: Fri, 20 Mar 2015 23:08:35 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/2.7.x-fixes 6be44c2be -> 50f1eaf66 [CXF-6302] Initial support for URL-encoded RS destinations Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/50f1eaf6 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/50f1eaf6 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/50f1eaf6 Branch: refs/heads/2.7.x-fixes Commit: 50f1eaf668fa2fc6121846e07fb9d5e36e27feec Parents: 6be44c2 Author: Sergey Beryozkin Authored: Fri Mar 20 22:56:17 2015 +0000 Committer: Sergey Beryozkin Committed: Fri Mar 20 23:08:12 2015 +0000 ---------------------------------------------------------------------- .../apache/cxf/jaxrs/client/AbstractClient.java | 2 +- .../transport/http/DestinationRegistryImpl.java | 17 ++++++++++++----- .../jaxrs/JAXRSClientServerSpringBookTest.java | 4 ++-- .../src/test/resources/jaxrs/WEB-INF/beans.xml | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/50f1eaf6/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java index 84cc4e7..d74fe3d 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java @@ -746,7 +746,7 @@ public abstract class AbstractClient implements Client, Retryable { } protected static void reportMessageHandlerProblem(String name, Class cls, MediaType ct, - Throwable cause, Response response) { + Throwable ex, Response response) { org.apache.cxf.common.i18n.Message errorMsg = new org.apache.cxf.common.i18n.Message(name, BUNDLE, http://git-wip-us.apache.org/repos/asf/cxf/blob/50f1eaf6/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java ---------------------------------------------------------------------- diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java index edfe5c2..539ba6f 100644 --- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java +++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java @@ -85,9 +85,19 @@ public class DestinationRegistryImpl implements DestinationRegistry { } public AbstractHTTPDestination checkRestfulRequest(String address) { + AbstractHTTPDestination ret = getRestfulDestination(getDestinationsPaths(), address); + if (ret == null) { + ret = getRestfulDestination(decodedDestinations.keySet(), address); + } + if (ret != null && ret.getMessageObserver() == null) { + return null; + } + return ret; + } + private AbstractHTTPDestination getRestfulDestination(Set destPaths, String address) { int len = -1; AbstractHTTPDestination ret = null; - for (String path : getDestinationsPaths()) { + for (String path : destPaths) { String thePath = path.length() > 1 && path.endsWith(SLASH) ? path.substring(0, path.length() - 1) : path; if ((address.equals(thePath) @@ -99,10 +109,7 @@ public class DestinationRegistryImpl implements DestinationRegistry { len = path.length(); } } - if (ret != null && ret.getMessageObserver() == null) { - return null; - } - return ret; + return ret; } public Collection getDestinations() { http://git-wip-us.apache.org/repos/asf/cxf/blob/50f1eaf6/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java ---------------------------------------------------------------------- diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java index 90e5d2d..36f4e44 100644 --- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java +++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java @@ -93,7 +93,7 @@ public class JAXRSClientServerSpringBookTest extends AbstractBusClientServerTest @Test public void testGetBookWebEx4() throws Exception { - final String address = "http://localhost:" + PORT + "/the/thebooks3/bookstore/books/webex2"; + final String address = "http://localhost:" + PORT + "/the/thebooks%203/bookstore/books/webex2"; doTestGetBookWebEx(address); } @@ -337,7 +337,7 @@ public class JAXRSClientServerSpringBookTest extends AbstractBusClientServerTest @Test public void testGetBookByUriInfo2() throws Exception { String endpointAddress = - "http://localhost:" + PORT + "/the/thebooks3/bookstore/bookinfo?" + "http://localhost:" + PORT + "/the/thebooks%203/bookstore/bookinfo?" + "param1=12¶m2=3"; getBook(endpointAddress, "resources/expected_get_book123json.txt"); } http://git-wip-us.apache.org/repos/asf/cxf/blob/50f1eaf6/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml ---------------------------------------------------------------------- diff --git a/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml b/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml index af06224..06b206d 100644 --- a/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml +++ b/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml @@ -76,7 +76,7 @@ http://cxf.apache.org/schemas/core.xsd"> + address="/thebooks%203/bookstore">