users@jersey.java.net

Re: [Jersey] UriBuilder.segments() with semicolon

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 22 Jul 2009 08:47:31 +0200

On Jul 22, 2009, at 5:47 AM, Igor Minar wrote:

> semicolon is a valid path (segment) separator (just like '/'), so I
> assume that's why it is not being encoded.
>

I think this is an issue. The following:

         URI u = UriBuilder.fromPath("/a/
b").segment("x;y").matrixParam("e;f", "g;h").build();
         System.out.println(u);

outputs:

   /a/b/x;y;e;f=g;h

I think segment should percent encode ";" as should be the case for
matrix parameter names/values.

One can use the path method when ";" is not meant to be percent encoded.

Paul.

> /i
>
> On Jul 21, 2009, at 6:12 PM, Trygve Laugstøl wrote:
>
>> Howdy
>>
>> I'd like to generate a path to an object with a semicolon:
>>
>> http://.../sessions/I like to eat cows; however, I don't like to be
>> eaten by them
>>
>> I use UriBuilder.segments("I like to eat cows; however, I don't
>> like to be eaten by them") and would expect the semicolon to be
>> escaped to %3b, but it's not.
>>
>> Is that expected behavior? Is there a better/proper way to encode
>> such paths?
>>
>> --
>> Trygve
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>