This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Imagine that you have a business interface by name 'Template'. Which of the following ways can be used by the Client Application to acquire a reference to the business interface (assuming that this interface is bound in the JNDI Context)?
Correct Answer: 4. I agree with 1 and 2.
In answer option 3, should'nt the context look up be something like
If you are using J2EE component clients(Servlet,EJBs,APPlication-client) then all of the above is true but if you are using stand-alone client,none of them is true.
You have to use traditional JNDI look up...
Correct me if i am wrong....
SCJP 6,SCWCD 5,SCBCD 5
Failure is not an option.
Joined: Aug 16, 2004
The last option 3. is correct even for stand alone client. You can use no arg constructor for initial context if you supply jndi.properties and there is no need to narrow if what you retieve is a business interface.
Joined: Sep 19, 2008
Yes. You are correct.
Sorry i saw this line "java:comp/ejb/template" as "java:comp/env/ejb/template"