Any idea whether we can Inject one JSF managed bean as a property into another JSF backing bean/managed bean?
I am trying to create a layer of abstraction between my backing beans and ejbs by creating a single managed bean that will have @EJB annotation to invoke the bean. This is my version of business delegate or service layer.
JSF Backing Bean -> JSF ManagedBean (Coordinator) ->EJB
The rule on injection is that you can't inject an object whose lifespan is shorter than the target.
JSF is not very friendly to request-scope objects, however, so you can't use them as often as you would in most web frameworks.
Injecting EJBs into JSF backing/managed beans is possible, but rarely a good idea, since you're injecting a specific instance statically declared, and most of the time you want the EJBs to be more dynamic than that.
An IDE is no substitute for an Intelligent Developer.