users@jersey.java.net

[Jersey] Re: Path Parameters

From: Christopher Currie <christopher_at_currie.com>
Date: Fri, 1 Jul 2011 17:29:54 -0700

Query parameters aren't valid as a part of the "path" (they're
considered separate from the path in the URI spec). So the jersey
client escapes the "invalid" character, in you really did want to
specify a path name that contains a question mark (I've seen stranger
things).

To fix it, remote the query string from the path call and insert a
call to queryParams before the delete call.
HTH,
Christopher

On 7/1/11, Jim Beard <jimbeard_at_uoregon.edu> wrote:
> Is there an example of using Path Parameters somewhere?
>
>
>
> I have the following code:
>
>
>
>
>
> WebResource webResource =
> client.resource("https://r25test.uoregon.edu/r25ws/servlet/wrd/run");
>
>
>
> ClientResponse response =
> webResource.path("r25user.xml?r25_username="+args[0]).delete(ClientRespo
> nse.class);
>
>
>
>
>
> And when it runs the ? converts to the hex encoded values, which is
> throwing a 500 internal server error on the web service server.
>
>
>
> The web service log shows:
> REQUEST_URI=/r25ws/servlet/wrd/run/r25user.xml%3Fr25_username=Oscar
>
>
>
> If I paste this in a browser I still get the 500 error, but if I replace
> the %3F with a ? then it seems to work.
>
>
>
> Thanks,
>
>
>
> Jim Beard
>
> Information Services
>
> University of Oregon
>
> (541) 346-1748
>
>
>
>

-- 
Sent from my mobile device