Robert,
Here's a very simple JSP page to do what you're asking. All you need to do
is edit the contextsToList string array to include the name of all the
contexts you would like to list.
Jeff Hubbach.
###### Begin JSP page ######
<%@ page import="javax.naming.*" %>
<%@ page import="java.util.Properties" %>
<html>
<head>
<title>JNDI Context listing</title>
</head>
<body>
<h2>JNDI Context</h2>
<%!
String[] contextsToList = new String[]{"","jdbc","jdbc/xa","java:comp"};
%>
<%
try {
Context jndiContext = new InitialContext();
NamingEnumeration list;
for( int i = 0; i < java.lang.reflect.Array.getLength(contextsToList);
i++) { %>
<b>Listing the context '<%= contextsToList[i] %>'</b><br><%
list = jndiContext.list(contextsToList[i]);
while (list.hasMore()) {
NameClassPair nc = (NameClassPair)list.next();
%><%= nc.getName() + ": " + nc.getClassName() %><br>
<% } %>
<br><br><%
}
} catch(Exception e) {
throw new RuntimeException("Exception thrown : "+e);
}
%>
</body>
</html>
###### End JSP page ######
On Thu, 19 Jul 2001 12:48:36 -0700
"Robert Ren" <[EMAIL PROTECTED]> wrote:
>Hi,
>Could anybody give me an example to list all the objects including EJBs,
>JDBC etc of a context after I initialized it in Orion?
>Thanks in advance!
>
>Rob
>
>