Advertisement
Armandobs14

Listing JNDI names

Nov 6th, 2014
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.20 KB | None | 0 0
  1. ArrayList<String> lista = new ArrayList();
  2. InitialContext ic = new InitialContext();
  3. NamingEnumeration<NameClassPair> list = ic.list("java:");
  4. while (list.hasMore()) {
  5.     lista.add(list.next().getName());
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement