What I understand - please correct me if I'm wrong.
There are two great technologies OSGI and CDI. I use glassfish 4 and when I started to use it I hoped that such great server will provide all I think. Now I need the use of both technologies and I'm a little bit shocked. As I see CDI with osgi works only with
servlet and
EJB. It means you can inject in servlet, but you can't inject in pojo. So what I have in practise:
Bundle1 - servlet - frontcontroller +
jsp
Bundle2 - service providing controllers and commands and models
Bundle3 - EJB.
I can inject EJB to servlet - that's ok. I can inject service to servlet. But I can't do the most necessary thing - I can't inject EJB to my controllers/commans etc. Can anyone explain where is my misunderstanding?