users@jersey.java.net

[Jersey] How do I encode URI parameter values?

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Wed, 14 Jan 2009 10:22:59 -0800 (PST)

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--tp2158392p2158392.html
Sent from the Jersey mailing list archive at Nabble.com.