users@jersey.java.net

Re: [Jersey] How do I encode URI parameter values?

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Wed, 14 Jan 2009 12:24:08 -0800 (PST)

Turns out that UriBuilder handles this perfectly. Thanks! :) Maybe they
should fold this into the core Java API.

Gili


Gili wrote:
>
> Hi,
>
> I want to send a URI as the value of a query/matrix parameter. It's not
> clear to me how to get Java to encode it before passing it to the URI. For
> example, I want:
>
> http://example.com/resource?key=<value>
>
> where <value> is http://google.com/resource?key=value
>
> Clearly <value> needs to be encoded because it may contain its own
> query/matrix parameters. Any ideas on how to do this in Java?
>
> PS: The answer is not URLEncoder. That corresponds to encoding for HTML
> forms, not URIs.
>
> Gili
>

-- 
View this message in context: http://n2.nabble.com/How-do-I-encode-URI-parameter-values--tp2158392p2158960.html
Sent from the Jersey mailing list archive at Nabble.com.