File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Using servlets with EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
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://aspose.com/file-tools
 
subject: Using servlets with EJB
 
Similar Threads
JUNIT to test EJB
Is WAS a good App server?
An EJB should behave as local and remote as well
Develop EJB using Netbeans
How I can use RMI with EJB?