Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 68606 invoked from network); 21 Oct 2008 16:06:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Oct 2008 16:06:11 -0000 Received: (qmail 29592 invoked by uid 500); 21 Oct 2008 16:06:12 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 29279 invoked by uid 500); 21 Oct 2008 16:06:11 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 29268 invoked by uid 99); 21 Oct 2008 16:06:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2008 09:06:11 -0700 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=FAKE_REPLY_C,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.77.186.17] (HELO mx3.progress.com) (192.77.186.17) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2008 16:05:01 +0000 Received: from mx3.progress.com (127.0.0.1) by mx3.progress.com (MlfMTA v3.2r9) id hvnuug0171si for ; Tue, 21 Oct 2008 12:05:26 -0400 (envelope-from ) Received: from progress.com ([192.233.92.16]) by mx3.progress.com (SonicWALL 6.2.2.1073) with ESMTP; Tue, 21 Oct 2008 12:05:26 -0400 Received: from NTEXFE02.bedford.progress.com (ntexfe02 [10.128.10.26]) by progress.com (8.13.8/8.13.8) with ESMTP id m9LG5QuC007630 for ; Tue, 21 Oct 2008 12:05:26 -0400 (EDT) Received: from sberyoz ([10.5.2.224]) by NTEXFE02.bedford.progress.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 21 Oct 2008 12:05:26 -0400 Message-ID: <011801c93396$d54241d0$e002050a@IONAGLOBAL.COM> From: "Sergey Beryozkin" To: "Sergey Beryozkin" , Subject: Re: URL escaping + Date: Tue, 21 Oct 2008 17:05:23 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-OriginalArrivalTime: 21 Oct 2008 16:05:26.0555 (UTC) FILETIME=[D4D416B0:01C93396] X-Mlf-Version: 6.2.2.1073 X-Mlf-UniqueId: o200810211605260208625 X-Virus-Checked: Checked by ClamAV on apache.org Sorry, sent too early...Anyway hope that it made sense :-) >I added this test case : > > @GET > > @Path("/booksquery") > > public Book getBookByQuery(@QueryParam("id") String id) { > > > String[] values = id.split("\\+"); > > StringBuilder b = new StringBuilder(); > > b.append(values[0]).append(values[1]); > > return books.get(Long.valueOf(b.toString())); > > } > > GET http://localhost:9080/bookstore/booksquery?id=12%2B3 > > Also added a similar test > > @GET > > @Path("{id}") > > public Book getBookById(@PathParam("id") String id) {} > > > handling GET http://localhost:9080/bookstore/id=12%2B3 > > > > All works fine on 2.2-SNAPSHOT (will work the same in 2.1.x shortly) > > > > Have I misundestood your request ? You're not using query > >> Hi, >> >> There's currently an issue with handling encoded URIs but it's been just fixed in 2.2-SNAPSHOT and will be merged shortly to >> 2.1.x branch. >> >> Just wouild like to clarify that this is a sample request URI : >> >> /foo/bar=A%2BB >> >> can you please tell me how are you retrieving the bar value ? >> is it like this : >> >> @Path("/foo/{barPair}") >> someMethod(@PathParam("barPair") String bar) >> >> Thanks, Sergey >> >> >>> Hi, >>> >>> I might have a problem with URL escaping +. >>> >>> Assuming I want to call a JAX-RS service foo with parameter bar and the value "A+B". A + in a URL is a space so we need to >>> escape it with %2B. If I have the URL /foo/bar=A%2BB then the service method should get the String "A+B". It however will get >>> the string "A B". If escape %2B again and use the URL /foo/bar=A%252BB then the method will receive the String "A+B". Is this is >>> a feature or is there some defect that causes this? >>> >>> Regards, >>> Lasse >> >