On Sat, 29 Mar 2003 [EMAIL PROTECTED] wrote:

> Date: Sat, 29 Mar 2003 18:03:21 +0100
> From: [EMAIL PROTECTED]
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Listing all JNDI resources available
>
> Hi there,
>
> Is it somehow possible to look up all JNDI configuration values available
> in a servlet/context?

You need to look at the JNDI Javadocs (package javax.naming):

  InitialContext ic = new InitialContext();
  Context resources = ic.lookup("java:comp/env");
  NamingEnumeration ne = resources.listBindings("");
  while (ne.hasMore()) {
    Binding b = ne.next();
    String resourceName = b.getName();
    Object resourceObject = b.getObject();
    ... do whatever you need ...
  }


> This would be quite fine for debugging purposes, and it seems there is no
> function available for this, only for looking up a specific value.
>
> thx
> Johannes

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to