Hi Marshall,
In theory we should be able to leverage javax.inject.Inject to
provide a consistent implementation for all compliant injectors. In
practice, it's not that simple. The devil in the details is GuiceFilter.
The problem is that HK2 requires us to construct a ServletContainer
to get a ServiceLocator, then pass that into the HK2-Guice bridge and
get back an Injector. In the flip side, Guice wants us to construct
GuiceFilter to get an Injector, and use it to inject ServletContainer.
Each framework assumes it comes first. It's not clear how they solved
this problem for Spring, but my guess is they don't have the equivalent
of GuiceFilter.
When I implemented Guice integration for Jersey 1.0, the first
thing I did was examine the Spring implementation. I suggest we begin by
doing the same here. I'll try to take a look over the next two days.
Please try to do the same on your end.
PS: The lack of Guice support is also one of the few issues preventing
me from adopting Jersey 2.
Thanks,
Gili