users@jersey.java.net

Re: [Jersey] How to access init-param values from a Jersey web application

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 20 May 2010 15:48:30 +0200

On May 20, 2010, at 3:36 PM, Martin Giese wrote:

> On 05/20/2010 03:25 PM, Paul Sandoz wrote:
>>
>>>
>>> jersey-core-1.0.3.jar
>>> jersey-server-1.0.3.jar
>>>
>>> Should I be using jersey-1.2 ?
>>>
>> I have
>>
>> Yes, you will need to switch to 1.1.4 or greater. IIRC support for
>> instantiating Application as a managed component was introduced in
>> JAX-RS 1.1.
> OK, thank you very much, it works with @PostConstruct in jersey 1.2!
>

Great.


> Almost. I can read what is defined in <context-param> but not what
> comes from an <init-param>. Not that it matters for my app right now,
> but I'm still curious...
>

The init params should be available from ServletConfig. Although if
you are deploying to the Grizzly servlet container there there might
be a bug depending on what version you are using.

Again there are unit tests for this that pass. Grizzly version 1.9.18-
i is used.

Paul.