This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Problem with EJB injection in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Problem with EJB injection in JSP" Watch "Problem with EJB injection in JSP" New topic

Problem with EJB injection in JSP

Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
I am trying to inject a session bean in a JSP as follows:

But mySessionBean always points to null when I execute the JSP. Is this a correct way to inject EJB in a JSP? Any pointers on this would be greatly appreciated.

Thanks and Regards
Senthil Kumar
Ranch Hand

Joined: Mar 13, 2006
Posts: 264
i guess you have to specify the JNDI name in the annotation.Also make sure that your jsp container supports Dependency injection

when you really want something, all the universe always conspires in your favour.<br /> <br />SCJP1.5-77%<br />SCWCD-89%
I agree. Here's the link:
subject: Problem with EJB injection in JSP
It's not a secret anymore!