PK z: META-INF/PK z:effMETA-INF/MANIFEST.MFManifest-Version: 1.0 Ant-Version: Apache Ant 1.7.1 Created-By: 10.0-b22 (Sun Microsystems Inc.) PK z:WEB-INF/PK z:WEB-INF/classes/PK z:WEB-INF/classes/com/PK z:璹JNDIbrowser.jsp<%@page import="javax.naming.*, javax.sql.*, java.sql.*"%> <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%! static public String DEF_CPATH = "jdbc/";%> <% //String contextPath = "java:comp/env/jdbc"; //String contextPath = request.getParameter("cpath"); String contextPath = null; if (contextPath == null) { contextPath = DEF_CPATH; }%> Test - JNDI browser

JNDI browser

Context looked up: <%= contextPath%>

<% InitialContext initCtx; Context envCtx; NamingEnumeration enum1 = null; int i = 0; try { initCtx = new InitialContext(); if ((envCtx = (Context) initCtx.lookup(contextPath)) == null) { out.println("

No " + contextPath + " context

"); } else { enum1 = initCtx.listBindings(contextPath); i = 1; } } catch (javax.naming.NamingException ex) { } catch (java.lang.NullPointerException ex) { out.println(ex); } %> <% while (enum1.hasMore()) {%> <% }%>
<%= i%> <%= ((Binding) enum1.next()).toString()%>
PK z:{K K $WEB-INF/classes/com/NewServlet.class1 2WX YZ Y[\] W^_ `abc d efg Wh ij k lm nopqrst uvw xyz {| x}~ &k l , ()VCodeLineNumberTableLocalVariableTablethisLcom/NewServlet;processRequestR(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Venum1 Ljavax/naming/NamingEnumeration;iIrequest'Ljavax/servlet/http/HttpServletRequest;response(Ljavax/servlet/http/HttpServletResponse;outLjava/io/PrintWriter; contextPathLjava/lang/String;envLjava/util/Hashtable;initCtxLjavax/naming/InitialContext; ExceptionsdoGetexLjavax/naming/NamingException;doPostgetServletInfo()Ljava/lang/String; SourceFileNewServlet.java 34text/html;charset=UTF-8 jmsjava/util/Hashtablejava.naming.factory.initial2com.sun.enterprise.naming.SerialInitContextFactory java.naming.provider.urllocalhost:1099javax/naming/InitialContext 3 javax/naming/Contextjava/lang/StringBuilder

No  context

T !Servlet NewServlet

Servlet NewServlet at  T

  List: 
javax/naming/Binding 4 :;javax/naming/NamingExceptioncom/NewServlet T  Short descriptionjavax/servlet/http/HttpServletjavax/servlet/ServletExceptionjava/io/IOException&javax/servlet/http/HttpServletResponsesetContentType(Ljava/lang/String;)V getWriter()Ljava/io/PrintWriter;put8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;(Ljava/util/Hashtable;)Vlookup&(Ljava/lang/String;)Ljava/lang/Object;append-(Ljava/lang/String;)Ljava/lang/StringBuilder;toStringjava/io/PrintWriterprintln listBindings4(Ljava/lang/String;)Ljavax/naming/NamingEnumeration;%javax/servlet/http/HttpServletRequestgetContextPathjavax/naming/NamingEnumerationhasMore()Z(I)Ljava/lang/StringBuilder;next()Ljava/lang/Object;closejava/lang/ClassgetNamejava/util/logging/Logger getLogger.(Ljava/lang/String;)Ljava/util/logging/Logger;java/util/logging/LevelSEVERELjava/util/logging/Level;logC(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V!,2345/*67 89:;5 ,,N:Y: W  W Y:#-Y:6------Y+ !>-Y"#-$-%&'-$-(-) : -) t6r%')+,&.01;3H4h6q7t9z:;<=>?@ABCDFHIHW7\ q<=t>?89@ABCDEFGHI;JKLMN+O;5|*+,*N,-./-0 +6fi g hj7* PQ89@ABCLMNR;5|*+,*N,-./-0 +6x{ y z|7* PQ89@ABCLMNST5-167 89UVPK z:sWEB-INF/sun-web.xml /WebApplication1 Keep a copy of the generated servlet class' java code. PK z:7s{WEB-INF/web.xml NewServlet com.NewServlet NewServlet /NewServlet 30 index.jsp PK z: index.jsp<%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> JSP Page

JSP Page

PK z: AMETA-INF/PK z:eff+META-INF/MANIFEST.MFPK z:AWEB-INF/PK z:AWEB-INF/classes/PK z:AWEB-INF/classes/com/PK z:璹IJNDIbrowser.jspPK z:{K K $(WEB-INF/classes/com/NewServlet.classPK z:sWEB-INF/sun-web.xmlPK z:7s{WEB-INF/web.xmlPK z: index.jspPK wR