Starting from scratch without any previous Jersey 1.x knowledge, I\'m having a hard time understanding how to setup dependency injection in my Jersey 2.0 project.
If you prefer to use Guice and you don't want to declare all the bindings, you can also try this adapter:
guice-bridge-jit-injector
Late but I hope this helps someone.
I have my JAX RS defined like this:
@Path("/examplepath")
@RequestScoped //this make the diference
public class ExampleResource {
Then, in my code finally I can inject:
@Inject
SomeManagedBean bean;
In my case, the SomeManagedBean
is an ApplicationScoped bean.
Hope this helps to anyone.