JBoss Community

Dependency Injection in EJB3

created by Swamy Nathan in EJB 3.0 - View the full discussion

Hi,

 

1. ) Can I inject a simple POJO Java bean/object using @javax.annotation.Resource into a EJB- Can we do this inside an EJB.

          @Resource

          private SimpleNotEjbType type;

 

2. ) Can I inject a DataSource using @javax.annotation.Resource into a non-ejb POJO being invoked by my EJB?

     public class SimpleNotEjbType

     {

          @Resource(mappedName="MyDS")

          private DataSource ds;

     }

 

Thanks.

S

Reply to this message by going to Community

Start a new discussion in EJB 3.0 at Community