• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Why Use ejb-ref?

 
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?
 
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!