tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominic Clay <dominic.c...@europrospectus.com>
Subject RE: what is JNDI ??? (Was JNDI - What resources are loaded? )
Date Fri, 28 Jun 2002 09:50:07 GMT
JAVA NAMING AND DIRECTORY INTERFACETM 

The Java Naming and Directory InterfaceTM (JNDI) is a standard extension to
the JavaTM platform, providing Java technology-enabled applications with a
unified interface to multiple naming and directory services in the
enterprise. As part of the Java Enterprise API set, JNDI enables seamless
connectivity to heterogeneous enterprise naming and directory services.
Developers can now build powerful and portable directory-enabled
applications using this industry standard

http://java.sun.com/products/jndi/


Dominic

-----Original Message-----
From: Power-Netz (Schwarz) [mailto:schwarz@power-netz.de] 
Sent: 28 June 2002 10:41
To: Tomcat Users List
Subject: AW: JNDI - What resources are loaded? 



OT: what is JNDI ???

>
> > Is there a way to list all of the JNDI Resources that are loaded for 
> > a particular context?
>
> Sure.
>
> Here is a snipp from my "JNDI browser" JSP:
>
> <%@ page
>   info="JNDI browser"
>   import="javax.naming.*, javax.sql.*, java.sql.*"
>   contentType="text/html; charset=windows-1250"
> %><%!
> static public String DEF_CPATH = "java:/";
> %><%
> //String contextPath = "java:comp/env/jdbc";
> String contextPath = request.getParameter( "cpath" );
> if( contextPath == null ) {
>   contextPath = DEF_CPATH;
> }
> %>
> <html>
> <head>
> <title>Test - JNDI browser</title>
> <meta http-equiv="Content-Type" content="text/html; 
> charset=windows-1250"> </head>
>
> <body bgcolor="#FFFFFF" text="#000000">
> <h1>JNDI browser</h1>
> <p>Context looked up: <strong><%= contextPath %></strong></p>
<%
> InitialContext initCtx;
> Context envCtx;
>
> initCtx = new InitialContext();
> if( (envCtx = (Context)initCtx.lookup( contextPath )) == null ) {
>   out.println( "<p>No " + contextPath + " context</p>" );
> } else {
>   NamingEnumeration enum = initCtx.listBindings( contextPath );
>   int i = 1;
> %>
> <table width="100%" border="1" cellspacing="0" cellpadding="3">
>   <%
>   while( enum.hasMore() ) {
> %>
>   <tr>
>     <td><%= i %></td>
>     <td><%= ((Binding)enum.next()).toString() %></td>
>   </tr>
> <%
>   }
> %>
> </table>
> </body>
> </html>
>
> Nix.
>


--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message