• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

the InitialDirContext object...

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I'm confused. When I receive back a 'loaded' InitialDirContext object, I can do a .search() on it, and in my case it's specific to LDAP, going, ctx.search(startingDirectory, filter, ctls) and then I'll get a return that I assign to a NamingEnumeration object. Great. But using the debugger in eclipse and exploding the contents of the InitialDirContext object I cannot for the life of me find this criteria inside it, despite getting a good result. Where does this information hide?? Is it magic?? Stuff like currentDN are ""...and yet I can still get a successful .search() from the object...

I'm glad it's working I guess, but not glad that I don't understand why.

Thanks for anything that could shed light on this.
G
 
G Lambert
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, so I have my own answer...but the question I posed is moot because it was the wrong object to go looking inside for the answer.

Separate from searching the InitialDirContext object I ran the following code and received the 'directory from which to start searching in':


environment is the hashtable full of the attributes required to login (i.e. the same hashtable passed to the InitialDirContext for authenticating).

In my case it appears as "C=name,DC=name" etc. but obviously, the result will entirely depend upon how the LDAP tree was set up...

Anyway, I thought I'd post the result in case anyone else doesn't immediately know how to search for the 'root' directory in LDAP if they don't know it.

reply
    Bookmark Topic Watch Topic
  • New Topic