File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes invoking ejb from jsp in websphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "invoking ejb from jsp in websphere" Watch "invoking ejb from jsp in websphere" New topic

invoking ejb from jsp in websphere

Shashi Bhushan N

Joined: Sep 02, 2003
Posts: 12
I am using websphere app developer v5.
I have a stateless session bean ConverterBean created in the package in the ejbmodule.
How would i import this bean in a jsp file which is in the web module.
I have tried the following but the thing is giving errors,that the bean converter is not found.

Thank you and regards.
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
If your problem is not importing the package, then use the JSP page directive with the import statement to import the package that you need. Read the JSP 1.1 specification (or ANY book on JSP) for details.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Howard Kushner
Ranch Hand

Joined: Sep 19, 2003
Posts: 361
Just looking over your code I see you are obtaining the converterhome in the jspInit method, but you are invoking the create method on the converterhome some time later when the service method gets invoked. That will surely cause problems, since the default scope for a JSP is page. I suggest that you consider maintaining a reference to a handle for your converterhome in some other scope (perhaps session or application) depending on your particular needs. HTH.

Howard Kushner<br />IBM Certified Enterprise Developer - WebSphere Studio Application Developer V5.0<br />IBM Certified Advanced System Administrator - WebSphere Application Server V5.0<br />IBM Certified Solution Developer - Web Services with WebSphere Studio V5.1<br /><a href="" target="_blank" rel="nofollow">Developing J2EE Applications with WebSphere Studio</a> my Certification Study Guide for IBM Test 287
I agree. Here's the link:
subject: invoking ejb from jsp in websphere
It's not a secret anymore!