The JNDI documentation and javadoc should show you how to do that. Once you have the InitialContext, use the list() method to get its contents. If any of the contents are contexts, cast them to Context and use the list() method. Very much like browsing a file and directory tree.