Java 接入LDAP小知识


ldap.url=ldap://10.1.3.129
<!--ldap configuration-->
<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
    <property name="url" value="$&#123;ldap.url&#125;"/>
    <property name="base" value="ou=people,dc=qunhe,dc=cc"/>
    <property name="baseEnvironmentProperties">
        <map>
            <entry key="com.sun.jndi.ldap.connect.timeout" value="5000"/>
        </map>
    </property>
</bean>

<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
    <constructor-arg ref="contextSource"/>
</bean>

Author: winjeg
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source winjeg !
  TOC