Welcome to the new Spring.io forums!
If this is your first visit, be sure to check out the
by clicking the link above, and for security reasons, use the
forgot password link to reset your password..
You may have to register before you can post: click the register
link above to proceed. To start viewing messages, select the forum that you want to visit
from the selection below.
I think I'm beginning to see how I could possibly do it outside of a spring context. I think I would do something like
LdapTemplate ldapTemplate = new LdapTemplate(contextSource);
where contextSource is a class I write that extends LdapContextSource in which I implement getDirContextInstance() and inside that I can put some previous code I wrote "in the old days" to set up a DirContext.
Assuming that will work, my next question is (which I could determine by testing it but I'll try this tomorrow) do I need to include in my classpath all of the libraries in the lib directory; e.g.,
Last edited by lumpynose; Oct 13th, 2006, 01:26 AM.
Sorry, I'm not sure if I explained it correctly because I don't understand your answer. I'm writing a module / class for someone else's app and part of what my module will be doing is some ldap lookups. The other app isn't using spring.
When you say "call afterPropertiesSet() once the instance properties have been initialized" I'm guessing you mean to call that method on the LdapTemplate object? But I don't understand how it will get a ContextSource unless I provide it with one, and I don't understand where to get a ContextSource unless I create one.
Since this is not running in spring there won't be any spring beans, which is where I'd ordinarly define my ContextSource.
You'll need to manually create your LdapContextSource instance, set the desired properties on that instance and then call afterPropertiesSet() on the LdapContextSource instance. Then you create your LdapTemplate instance, supply the LdapContextSource to that, and you're all set to do your LDAP operations.