This content has been marked as final.
Show 4 replies
-
1. Re: @Inject session bean into war
nickarls Mar 27, 2013 3:02 AM (in response to klind)That's a bit strange since usually the CDI implementation complains about injections points it can't fulfill. The only case where this usually happens when the instance doesn't come from the container (e.g. you have used new()), in which case injection can't occur.
-
2. Re: @Inject session bean into war
sfcoy Mar 27, 2013 7:59 AM (in response to klind)1 of 1 people found this helpfulHow does the object of the "pojo class in the web app that @Inject sessionbean" get created?
Injection only happens if the container creates the object for you.
-
3. Re: @Inject session bean into war
klind Mar 27, 2013 12:24 PM (in response to klind)This is an existing project where I slowly wanna implement injections, and you guys are right.
The pojo is created with the new operator.
So I guess I have to use @injection all the way... starting from the servlet ??
-
4. Re: @Inject session bean into war
nickarls Mar 27, 2013 4:12 PM (in response to klind)Yep, @Inject (or @EJB) is the way to go.