users@jersey.java.net

Re: Grizzly Container is completely wrong, if I read it correctly

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 29 Nov 2007 11:05:56 +0100

Salut,

Tu es vachement rapide !! I will start looking into it.

I suspected there might be an issue with URL encoded information hence
why i sneakily chose the query test :-)

I have hit this with every HTTP container i integrated into Jersey as it
is not clear when obtaining URI information from the container whether:

1) The information is in URI encoded or decoded form; and

2) what URI components are contained in the URI information, for example
    host, port, query, fragment etc.

Jersey requires two URIs from a container:

   1) The base URI the container was deployed at; and
   2) The complete request URI (with query and fragment)

(As documented by the AbstractContainerRequest.)

When a container creates those URIs it must use information directly in
URI encoded form (obtaining the information in decoded form and then
encoding looses information).

Paul.

Jeanfrancois Arcand wrote:
> Salut,
>
> attached is the first patch. You will need to pullout the Grizzly's jat
> from here[1]. Why first, it's because there seems to be an encoding
> problem (which was also with Grizzly 1.0) I need to look at because a
> simple query test fail. I'm attaching the tests as well so you can take
> a look to see if the bug is in Grizzly or not. My guess is not. I think
> the way the response is constructed is the problem as bytes as written
> without any char to bytes conversion.
>
> At least now you can use Grizzly 1.6.x and find more bugs :-).
>
> Let me know what you think.
>
> A+
>
> -- Jeanfrancois
>
> [1] http://download.java.net/maven/2/com/sun/grizzly/
>
> Paul Sandoz wrote:
>> Jeanfrancois Arcand wrote:
>>>> My preference would be to only support the latest greatest stable
>>>> Grizzly.
>>>
>>> Agree...and the latest is faster :-)
>>>
>>> I've ported the code (it compile with the latest Grizzlies jars)...
>>
>> Great!
>>
>>
>>> now I don't recall how to test it (as usual)....any pointers of what
>>> I should run/try before submitting the patch will be helpful!
>>>
>>
>> Perhaps the best thing to do is copy a unit test from the LW HTTP server.
>>
>> See the test package:
>>
>> com.sun.ws.rest.impl.container.httpserver
>>
>> and the classes:
>>
>> AbstractHttpServerTester
>> QueryParamTest
>>
>> You could copy these classes to the package
>>
>> com.sun.ws.rest.impl.container.grizzly
>>
>> and modify accordingly.
>>
>> Note that we do plan to improve the unit testing framework to make it
>> easy to test independent of the container but we are not their yet so
>> it is necessary to duplicate such tests.
>>
>> Paul.
>>

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109