users@glassfish.java.net

Access the global JNDI name

From: <glassfish_at_javadesktop.org>
Date: Mon, 30 Aug 2010 15:17:15 PDT

Hello everyone,

does anyone know if there is anyway to get the global JNDI name of a resource? I have a web app with resourse-ref defined in web.xml. When I deploy my app on Websphere 6.1 I specify the actual target resource (websphere queues in my case) for every resource in web.xml.

In my app I can access the resources by looking them up in "java:comp/env" subcontext, using ENC JNDI name (specified in web.xml)
My boss wants me to print out the global JNDI names of the resources on the web page (it's a little app he uses for testing purposes)

So the question is: what is the Java code to get the global JNDI name for a resource, provided ENC JNDI name?
[Message sent by forum member 'makhno77']

http://forums.java.net/jive/thread.jspa?messageID=481303