Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get "everything" from javax.naming.InitialContext? [duplicate]

Tags:

java

jndi

Is it possible to retrieve "everything" (all names) from javax.naming.InitialContext? I didn't find any examples or documentation about it.

like image 823
yegor256 Avatar asked Oct 29 '10 15:10

yegor256


2 Answers

Looking at the JavaDoc I can see that .list(String name) will return the list of names in the named context and that .getNameInNamespace() will return the name of the InitialContext. So perhaps you can do:

ctx.list(ctx.getNameInNamespace());
like image 174
DMKing Avatar answered Nov 14 '22 22:11

DMKing


It is as simple as:

ctx.list("")

like image 43
Hexum2600 Avatar answered Nov 15 '22 00:11

Hexum2600