users@jersey.java.net

Re: [Jersey] encoding a jersey request

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 12 Feb 2009 18:22:19 +0100

On Feb 12, 2009, at 6:15 PM, paradisonoir wrote:

>
> Hi,
>
> Assuming my url address, I want to add/encode my employeeID to this
> address,
> so I have encoded
> http://localhost:8080/employee/{sessionID} =>value of employee ID
>
> String url = "http://localhost:8080/employee";
> String employeeID;
>
> URI destination =
> UriBuilder.fromUri(Url).buildFromEncoded(employeeID);
>
> Is there any other way to encode my request?
>
> what if I want to add /employee as my path? So I don't need to hard
> coded in
> my url.
>

Do you mean doing

   resource.path(employeeID)....

?

See JavaDoc of:

https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.0.2/api/jersey/com/sun/jersey/api/client/WebResource.html
#path(java.lang.String)

Paul.