dev@jersey.java.net

Re: percent escapes in URI templates

From: Julian Reschke <julian.reschke_at_gmx.de>
Date: Wed, 20 Jun 2007 20:41:19 +0200

Marc Hadley wrote:
> I think Paul means whether the @UriTemplate annotation's value should be
> an escaped or unescaped string.

I see. That may be confusing, as if it's not what the Request-URI was,
it's not really a URI anymore, right?

>> A related question is whether the framework is supposed to do
>> something with percent-escaped non-ASCII characters. That would have
>> the beauty that there's one thing less people can do wrong...
>>
> My working assumption (which isn't reflected in the Javadoc right now)
> is that @UriParam, @QueryParam and @MatrixParam will all do any
> unescaping automatically so in your example you'd get "Hello x y" rather
> than "Hello x%20y" for a GET on /helloworld/x%20y.
>
> We should have this discussion on dev_at_jsr311 - I'll send a note
> something shortly.

Yep, that needs to be decided. Of course "%20" is the simple case. But
then, what about "%c3%bc"?

If the runtime doesn't decode it for me (to "ü"), there should be some
API included to do it "right". Right now, I think I'd slightly prefer
not to overload the URI template engine with it.

Best regards, Julian