Is there any situation where it's better to use JNDI than to inject a stateless session bean using the @EJB
annotation?
We're using JSF 1.2 with Sun Application Server 9.0_01.
Our team is debating which approach is better when using SLSBs in a Managed Bean.
I've read the following questions, but was wondering if there was a situation where lookup is preferred.
Is there any situation where it's better to use JNDI than to inject a stateless session bean using the @EJB annotation?
There's no situation where it's better--but situations where it's necessary:
If the name to look up is constant and injection is possible, prefer @EJB
annotations: