Return-Path: X-Original-To: apmail-cxf-dev-archive@www.apache.org Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2D27469E5 for ; Mon, 25 Jul 2011 17:08:52 +0000 (UTC) Received: (qmail 77921 invoked by uid 500); 25 Jul 2011 17:08:51 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 77739 invoked by uid 500); 25 Jul 2011 17:08:50 -0000 Mailing-List: contact dev-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 dev@cxf.apache.org Received: (qmail 77731 invoked by uid 99); 25 Jul 2011 17:08:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jul 2011 17:08:50 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sberyozkin@gmail.com designates 74.125.82.49 as permitted sender) Received: from [74.125.82.49] (HELO mail-ww0-f49.google.com) (74.125.82.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jul 2011 17:08:43 +0000 Received: by wwf22 with SMTP id 22so3721086wwf.6 for ; Mon, 25 Jul 2011 10:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=A4b2OtYzH5Jvqb9rtfYRUxMUl/Hd2+AbmSdOsqnk21w=; b=EiyN2jnoSVMYgpyxr6sSIil9H0clFD4bNDJh4a1a6rM5sBBbX8/mhqVATqsNUQaU2J S85aaYlugQ8krDNMFYEIBKyeT2Ks9m6r6PcQGsWQYk4oKy/erTwTfhyQ9DkkvoUvVE9R M9Yn+ACJBx1+4UfRcDW4NweHcBFX3G9Wkhbrc= Received: by 10.227.198.130 with SMTP id eo2mr4079651wbb.50.1311613701509; Mon, 25 Jul 2011 10:08:21 -0700 (PDT) Received: from [10.36.226.3] ([217.173.99.61]) by mx.google.com with ESMTPS id 20sm4487777wbw.2.2011.07.25.10.08.20 (version=SSLv3 cipher=OTHER); Mon, 25 Jul 2011 10:08:20 -0700 (PDT) Message-ID: <4E2DA303.2040400@gmail.com> Date: Mon, 25 Jul 2011 18:08:19 +0100 From: Sergey Beryozkin User-Agent: Thunderbird 2.0.0.24 (X11/20101027) MIME-Version: 1.0 To: dev@cxf.apache.org Subject: Re: why path_info is contextPath + req.getPathInfo() References: <4e2a645f.8224440a.42a2.ffffec6e@mx.google.com> In-Reply-To: <4e2a645f.8224440a.42a2.ffffec6e@mx.google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi > hi,every body > when i extends CXFServlet to dispacth request by http header Content-Type,i found that in AbstractHTTPDestination#setupMessage > inMessage.put(Message.REQUEST_URI, req.getRequestURI()); > inMessage.put(Message.PATH_INFO, contextPath + req.getPathInfo()); > > the two statements above ,the first put Message.REQUEST_URI into inMessage ,and the second put Message.PATH_INFO into inMessage,if my request url is http://localhost:8080/cxf/ws/rest1/roomservice/room/12 and > org.apache.cxf.request.uri=/cxf/ws/rest1/roomservice/room/12, > org.apache.cxf.message.Message.PATH_INFO=/cxf/rest1/roomservice/room/12 > why servlet-mapping "ws" is removed? I can see PATH_INFO is used by some CXF code, but the only reason it works is because the code which relies upon it checks it againt Message.BASE_PATH which also misses servletPath(). Would you be interested in creating a patch ? Adding String contextServletPath = contextPath + req.getServletPath(); inMessage.put(Message.PATH_INFO, contextServletPath + req.getPathInfo()); instead of inMessage.put(Message.PATH_INFO, contextPath + req.getPathInfo()); and also replacing few lines below String basePath = getBasePath(contextPath); with String basePath = getBasePath(contextServletPath); should do it. verify this fix if you can, otherwise please open a JIRA and we will look into it... Cheers, Sergey > > 2011-07-23 > > > > qiuboboy