I’m not sure I know the definitive answer, but let me give you just a bit of a warning:
@Context should be ONLY used to inject the JAX-RS API components explicitly stated in the JAX-RS spec (section 5.2 in JAX-RS 1.x and section 9.2 in JAX-RS 2.0) - injecting anything else, even if it may work today is essentially an API leak and should be avoided. Please use @Inject instead for arbitrary injection.
Marek
> On 11 Jun 2015, at 07:49, Martynas Jusevičius <martynas_at_graphity.org> wrote:
>
> Hey,
>
> is it possible to inject typed lists using @Context?
>
> I've implemented a custom provider that extends
> PerRequestTypeInjectableProvider<Context, List<MediaType>>. I am not
> sure however what to pass to its constructor. If I use List.class, the
> provider is not picked up.
>
> Any thoughts? Thanks.
>
> Martynas