Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8902

Re: EJB JNDI Lookup String?

$
0
0

Hi Frank,

 

The example you mention shows how to look up the EJB declared in a servlet from jsp. So in this particular case the lookup string would be <fully-qualified name of declaring class>/<field-name>(in the example - hello.HelloWorldServlet/helloWorldBean)

 

If you'd like to use another lookup name, you may take advantage of @EJB name attribute:

EJB (Java EE 6 )

 

E.g.

@EJB (name= "test")

private HelloWorldBean helloWorldBean

 

and then lookup it via HelloWorldBean h= (HelloWorldBean)ic.lookup("java:comp/env/test");

 

Hope that helps,

Katya

 

Message was edited by: Vladimir Pavlov


Viewing all articles
Browse latest Browse all 8902

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>