用于列出远程计算机上jndi中所有条目的代码 [英] Code to list all the entries in jndi on remote machine

查看:70
本文介绍了用于列出远程计算机上jndi中所有条目的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉或指出代码列出远程机器中的所有jndi条目

Can any one tell or point me to code to list all the jndi entries in a remote machine

推荐答案

这是可能的列出InitialContext的所有条目。您可以使用以下代码段:

It is possible to list all entries of an InitialContext. You can use this snippet:

InitialContext ctx = new InitialContext();
NamingEnumeration<NameClassPair> list = ctx.list("");
while (list.hasMore()) {
  System.out.println(list.next().getName());
}

如果您使用的是应用程序服务器,通常可以选择浏览JNDI树。

If you are using an application server, there is usually the option to browse the JNDI tree.

这篇关于用于列出远程计算机上jndi中所有条目的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆