Two Laptop Bag
The moose likes Servlets and the fly likes Using servlets with EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Using servlets with EJB" Watch "Using servlets with EJB" New topic
Author

Using servlets with EJB

Vipul Shinde
Greenhorn

Joined: Sep 27, 2005
Posts: 6
Hi,
Can any one tell me how can I use a EJB(Entity/Session) in a servelt.

If I want to use it in any of request methods i.e. doGet , doPost how should I work with it ?
Satish Chilukuri
Ranch Hand

Joined: Jun 23, 2005
Posts: 266
Hi,

Can any one tell me how can I use a EJB(Entity/Session) in a servelt.


Have you worked with EJBs before? If yes then the answer would be to use them in the same way. (Look up the Home, create a bean etc..). If you haven't, the question is related to EJBs and not to servlets and you might consider going through some EJB tutorials and use the EJB forum if you have any doubts.
Keith Pitty
Ranch Hand

Joined: Sep 22, 2005
Posts: 32
Your servlet would need to act as a client to the EJB.

Briefly, it would need to use JNDI to locate the EJB, then use the EJB's Home interface to create an EJB bean instance before invoking methods on that instance via the EJB's Remote instance.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Using servlets with EJB
 
Similar Threads
How I can use RMI with EJB?
An EJB should behave as local and remote as well
JUNIT to test EJB
Develop EJB using Netbeans
Is WAS a good App server?