Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDI access to J2EE components

 
Shobhan Ganta
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

This question is from HFSJ mock exam 11 Q.9

Which are DD elements that provide JNDI access to J2EE components?
(Choose all that apply.)
A. <ejb-ref>
B. <entity-ref>
C. <ejb-local-ref>
D. <session-ref>
E. <ejb-remote-ref>


The correct answer given is A, C (explanation : (servlet spec 9.11)-In addition, <ejb-local-ref> also provides the web app creator with a JNDI reference to J2EE components.)

but I feel the following code snippet will be used for declaring the JNDI access.
<env-entry>
<env-entry-name>rates/discountRate</env-entry-name>
<env-entry-type>java.lang.Integer</env-entry-type>
<env-entry-value>10</env-entry-value>
</env-entry>


I don't see any of these tags available in the question options. Can someone please explain?

Thanks
Shobhan
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2536
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any of these tags available in the question options. Can someone please explain?

You are right env-entry also has to do with JNDI lookup, but according to the Servlet2.4 spec all of the following tags have to do with JNDI lookup:

SRV.13.1 Deployment Descriptor Elements
Syntax for looking up JNDI objects (env-entry, ejb-ref, ejb-local-ref, resource-ref, resource-env-ref)


Regards,
Frits
 
Shobhan Ganta
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frits.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic