Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 60265 invoked from network); 28 Jun 2002 09:42:21 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by 209.66.108.5 with SMTP; 28 Jun 2002 09:42:21 -0000 Received: (qmail 24302 invoked by uid 97); 28 Jun 2002 09:42:21 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 24286 invoked by uid 97); 28 Jun 2002 09:42:20 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 24270 invoked by uid 98); 28 Jun 2002 09:42:20 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) From: "Power-Netz \(Schwarz\)" To: "Tomcat Users List" Subject: AW: JNDI - What resources are loaded? Date: Fri, 28 Jun 2002 11:41:06 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <003e01c21e63$816fab50$6e3da8c0@ev.co.yu> X-Spam-Rating: 209.66.108.5 1.6.2 0/1000/N X-Spam-Rating: 209.66.108.5 1.6.2 0/1000/N 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; > } > %> > > > Test - JNDI browser > > > > >

JNDI browser

>

Context looked up: <%= contextPath %>

> <% > InitialContext initCtx; > Context envCtx; > > initCtx = new InitialContext(); > if( (envCtx = (Context)initCtx.lookup( contextPath )) == null ) { > out.println( "

No " + contextPath + " context

" ); > } else { > NamingEnumeration enum = initCtx.listBindings( contextPath ); > int i = 1; > %> > > <% > while( enum.hasMore() ) { > %> > > > > > <% > } > %> >
<%= i %><%= ((Binding)enum.next()).toString() %>
> > > > Nix. > -- To unsubscribe, e-mail: For additional commands, e-mail: