aspose file tools*
The moose likes Servlets and the fly likes Why Use ejb-ref? 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 » Servlets
Bookmark "Why Use ejb-ref?" Watch "Why Use ejb-ref?" New topic
Author

Why Use ejb-ref?

Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
I know that using the ejb-ref element in the web.xml file will ensure that the ejb is available when the web application is deployed. Is there any other reason to use the ejb-ref element? Does its usage have any impact on somehow notifying your web application if the ejb jar is redeployed?
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
Originally posted by Anthony Watson:
I know that using the ejb-ref element in the web.xml file will ensure that the ejb is available when the web application is deployed. Is there any other reason to use the ejb-ref element? Does its usage have any impact on somehow notifying your web application if the ejb jar is redeployed?


The ejb-ref actually declares a "logical name" for an EJB for use within your webapp. So, say the real JNDI name for my EJB is "ejb/AbcBean", but I refer to it in my webapp as "ejb/XyzBean", that's okay. The deployer (typically us unlucky developers) has to map those logical references to physical or actual references at deployment time. This level of indirection/abstraction allows us to piece together J2EE components more easily.


James Carman, President<br />Carman Consulting, Inc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why Use ejb-ref?
 
Similar Threads
use of service-ref in ejb-jar.xml file
Why Use ejb-ref?
How to define <ejb-link> if the ejb resides in another EAR
ejb-link element....
Order of elements in the DD- web.xml file