dev@glassfish.java.net

Re: REST API and slashes in resource names

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Wed, 02 Jun 2010 12:12:23 -0700

On 6/2/10 11:59 AM, Bill Shannon wrote:
> Ken Paulsen wrote on 06/ 2/10 10:49 AM:
>>
>> I think the reason it is decoded is this: The Container receives a
>> request like "/foo/at%40test.html" which then must be decoded to serve
>> up a file named "/foo/at_at_test.html". '@' and many other characters not
>> allowed in URLs must be encoded when they're used in a file name, so the
>> container must decoded them *before attempting to resolve them*.
>
> I guess the issue is whether that decoding should be done before
> interpreting the string to choose the destination servlet or
> whether the destination servlet (e.g., the default file handling
> servlet) should do the decoding before using the value.
>
> I would expect the Servlet spec to say something about this. If
> it requires the decoding to be done before passing the value to the
> Servlet, there may be little we can do.
>
> If there's a mapping for /foo/bar/*, should a URL of the form
> /foo%2Fbar/index.html match it?
I believe one of motivation of decoding is for matching multi-byte
characters.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>