Best practice for configuring Spring LdapTemplate via annotations instead of XML?
问题 For a Spring Boot application, I successfully configured a Spring LdapTemplate using annotations , including the LdapContextSource dependency with @Value s from application.properties. (Woot! I couldn't find an example, so maybe this will help others.) The snippets (below) setup the context source, inject it into an LdapTemplate , and autowire that into my DirectoryService. Is there a better/cleaner way to setup the ContextSource in a Spring Boot app? application.properties (on the classpath)