Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why Use ejb-ref?

 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic