users@jersey.java.net

[Jersey] Cannot get ContextResolver<T> to work. (Stand-alone example included.)

From: <gima_at_iki.fi>
Date: Tue, 11 Feb 2014 22:01:43 +0200

Evening,

_Problem:_
To my understanding ContextResolver<T> should provide instance(s) of T.
Also to my understanding when I register ContextResolver<T> with Jersey,
fields of type T in a @Path annotated class should be filled, assuming
they are annotated with @Context, of course.

_Question:_
The said field stays null no matter what. Am I doing or understanding
something incorrectly?

I have an example project, and the three classes in question linked
below for easy access (Main, TestClassResolver and HttpResource).

* Main:
https://github.com/gima/jerseyContextResolverExample/blob/master/src/main/java/notdf/Main.java

* TestClassResolver:
https://github.com/gima/jerseyContextResolverExample/blob/master/src/main/java/notdf/TestClassResolver.java

* HttpResource:
https://github.com/gima/jerseyContextResolverExample/blob/master/src/main/java/notdf/HttpResource.java

* ProjectRoot: https://github.com/gima/jerseyContextResolverExample


-Gima