Re: Programmatic Lookup of @Context items

Ondrej Mihályi

Injection via Context  also works in Java SE if you register resources as classes, becaus3 Jersey instantiates them and injects needed values when a request is handled.

If you instantiate resource classes yourself and register created objects with Jersey, injection would still work if you inject with Context a value as a method parameter. Jersey executes the method and injects needed values.

So in short, injection in resource classes works also in Java SE.


Dňa so 21. 4. 2018, 7:40 Jason Lee <jason@...> napísal(a):

Long story short, I find myself in need of being able to lookup manually those objects normally injected vi @Context (or @Inject) in a Java SE environment. I've been digging through the Jersey and JAX-RS docs, but nothing's standing out. Can someone give me a nudge in the right direction?


jason lee

Join to automatically receive all group messages.