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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "@EJB injection to servlet" Watch "@EJB injection to servlet" New topic
Author

@EJB injection to servlet

Krzysztof Miarecki
Greenhorn

Joined: Nov 26, 2009
Posts: 6
Lets assume, that we have a servlet with dependency injected ejb into instance field:


Servlet and EJB run on different JVMs (and different machines).
How it works?
1. Injected ejb remains the same object per servlet lifetime or it works as a service locator every time servlet wants something from ejb?
2. What if the injected ejb should be destroyed because of some exception - container injects new ejb automatically?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @EJB injection to servlet
 
Similar Threads
Using JNDI lookup to get access to the EJB
EJB DI
why resource injection is not allowed in web client for EJB 3.0?
@EJB annotation from a servlet
@EJB