cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: path param, query param, and encoded urls
Date Mon, 12 Apr 2010 10:18:16 GMT
Hi


On Mon, Apr 12, 2010 at 10:43 AM, Linus Kamb <kamb@emsc-csem.org> wrote:

> Hi,
>
> This isn't too serious to me, but I am seeing some strange behavior when I
> have both a PathParam and a QueryParam, and an encoded query.
>
> I have a service with an interface as follows:
>
>        @Produces({"application/xml","text/xml"})
>        @GET
>        @Path("/get/{userid}")
>        public String getCartXML(@PathParam("userid") String userId,
>                                         @QueryParam("start") String start)
>                                         @QueryParam("limit") String limit)
> [..]
>
> If I invoke the service with the following query:
>
> /services/event/cart/get/linus?limit=all
>
> I see in my logs:
>
> userid = linus, limit = all
>
> and all is good.
>
> However, if I use:
>
> /services/event/cart/get/linus%3Flimit%3Dall
>
> I see in my logs:
>
> userid = linus?limit=all, limit = null
>

I'm not sure that it's possible to have a query component identifier (?)
encoded without it being regarded to be part of the path component.

I think what you observe is expected, you really have a URI with the last
path segment "linus%3Flimit%3Dall", and no query string

cheers, Sergey



> and, of course, not happy.
>
> Am I doing something wrong in the mixing of path and query params?
>
> cheers,
> Linus
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message