users@jersey.java.net

[Jersey] Re: init params are not passed to a custom ResourceConfig - jersey 2.9

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Fri, 20 Jun 2014 18:09:18 +0200

Hi can you provide a small reproducer project that would demonstrate the problem? The properties should get propagated to your resource config after it is instantiated by the ApplicationHandler (on line 315).

Marek

On 20 Jun 2014, at 01:19, Sameer Shah <ssameer_at_yahoo-inc.com> wrote:

> Hi,
>
> I am trying to dynamically setup the jersey ServletContainer. I am extending the ResourceConfig and passing the class name as init parameters “ServletProperties.JAXRS_APPLICATION_CLASS". Along with these initParameters, there are some other params I am passing as well, which I intend to read from the ResourceConfig. (I need these parameters to bind a singleton using HK2).
>
> When I initialize the servlet I see that the resourceConfig is created but the initParameters are not passed to my ResourceConfig. While debugging through this, I found that internally the WebComponent creates the WrappingResourceConfig and also passes the initParam to it. But these init params are never added to my resourceConfig implementation.
>
> Is this the intended behavior? Please guide me if this is not how it is intended to achieve what I am trying.
>
> Thanks,
>
> Sameer