users@jersey.java.net

Re: [Jersey] Set ServletContext info as an init-param for Grizzly/HTTP container

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 17 Nov 2008 17:02:04 +0100

On Nov 17, 2008, at 4:51 PM, Jeanfrancois Arcand wrote:

> Salut,
>
> Paul Sandoz wrote:
>> On Nov 17, 2008, at 11:57 AM, Srinivas Naresh Bhimisetty wrote:
>>> Paul Sandoz wrote:
>>>>
>>>> On Nov 17, 2008, at 7:13 AM, Srinivas Naresh Bhimisetty wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have come across a scenario where I need to set the Servlet
>>>>> Context information to the GrizzlyContainer / HTTPContainer.
>>>>> Is there any provision where I could pass this info as an init
>>>>> param to the GrizzlyWebContainerFactory / ContainerFactory, in
>>>>> order to set it?
>>>>>
>>>>
>>>> I am not sure if the Grizzly ServletAdapter supports the setting
>>>> of context parameters. From the JavaDoc [1] it looks unlikely.
>>> Yes I tried this, but it doesn't work.
>>> We need this way of passing the ServletContext name, context init
>>> params, etc. for certain samples in order to get them running
>>> properly with the GrizzlyContainer and the HTTPContainer of the
>>> test framework, otherwise we see some test failures and errors, as
>>> I saw with the "spring-annotations" and the "simple-servlet"
>>> samples. These tests work fine with the Embedded Glassfish as the
>>> info is maintained in the deployment descriptors.
>>>
>> For now i would not pursue this area. The Grizzly servlet currently
>> provides a subset of web container functionality. So i think a test
>> should state which containers it supports, if different from the
>> default.
>
> Hum...looks like a bug. We do support the ServletContext init
> params. I've filled:
>
> https://grizzly.dev.java.net/issues/show_bug.cgi?id=320
>
> and will deliver a fix as soon as possible. Can someone point me to
> a test I can use to see what's happening?
>

Thanks!

I think Simple-servlet sample is failing because there are Web pages
served, the web.xml has no servlet context set up. I suspect the
Bookstore sample will not work because it requires JSP/JSTL support.

In general i don't think we can abstract fully between the APIs and
instead there should be configuration and a way for the test to
explicitly configure for an API, if required.

Paul.