Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I use Dependency Injection to Call EJBs in JSP?

 
Jiaxu Gu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an Enterprise Application in my netbeans which has an ejb module and a web module. Now I use jndi lookup to access the ejbs from the JSP. Is there any means that I can use DI(@EJB) to Injection the beans to JSP?
Thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35744
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jiaxu,
It is extremely poor practice to be calling EJBs from JSPs in the first place. If you are refactoring your code, you should refactor it to have the EJB call in the servlet.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!