• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Annotations for Environment Entries

 
Charles O'Leary
Ranch Hand
Posts: 54
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Annotations for Environment Entries

When the annotation is applied to the bean class , the jndi name and the environment entry type must be explicitly specified.


Injection of EJB References

The following example illustrates use of all portable elements of the EJB annotation. In this case, the
enterprise bean reference would have the name java:comp/env/ejb/shopping-cart in the
referencing bean’s naming context. This reference is linked to a bean named cart1.


In the example above, where is the explicit specification of the jndi name and the environment entry type? If not shown, how would it look? Or have I taken this out of context?
 
Himai Minh
Ranch Hand
Posts: 1360
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think "ejb/shopping-cart" is the JNDI name of myCart.
"ShoppingCart" is the environment entry type.
 
Charles O'Leary
Ranch Hand
Posts: 54
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's has always been my interpretation as well. Although "explicitly specified" wording may perhaps be better worded as perhaps either implied, defaulted, or derived?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic