• Post Reply Bookmark Topic Watch Topic
  • New Topic

Best way to inject a Container Managed bean into a Java Class  RSS feed

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I have a project that I am working on and was wondering how to inject a container managed bean into a java class.....some things I have looked at is JNDI lookup using context which is pretty straight forward but what are the alternatives? Is JNDI Lookup the preferred way? I tried @Inject but I couldn't get it to work, seems like it only works for classes maintained by the container.....




This is the CategoryFacade Bean

 
Bring me the box labeled "thinking cap" ... and then read this tiny ad:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!