Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP & EJB compatibility

 
r venkat
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends,
i would like to know how i can connect my ejbean in my JSP?
can any one help.
-ven
 
Dustin Marx
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if this will answer what you are asking, but I'll give it a try.
The application server normally provides an EJB container and a JSP container and allows for you to change appropriate settings to let EJBs and JSPs communicate with one another. At that point, you can have Java directly in the JSP (or in a JavaBean used by the JSP) access EJBs as normal Java code does (getting the home interface, etc.).
 
r venkat
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'll give it a try thanks
post your result too
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dustin, is absolutely correct
Venkat, you would need to remember that JavaBean is acting as a client to your EJB, for your JSP.You will have to get the instance of the HomeObject to create an instance of EJBObject in your JavaBean later in your code, to access the EJB.
The following sample code might be helpful to you.

Regards,
Sandeep Desai
vgdesai@bom3.vsnl.net.in

  1. Sun Certified Java Programmer Scored 93 per cent
  2. Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
  3. IBM Enterprise Connectivity with J2EE Scored 72 per cent
  4. Enterprise Development on the Oracle Internet Platform Scored 44 out of 56

  5. [This message has been edited by Desai Sandeep (edited April 27, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic