- <bean id="propertyConfigurer"
- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="location">
- <value>classpath:ldap.properties</value>
- </property>
- </bean>
- <bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
- <property name="url" value="${url}" />
- <property name="base" value="${base}" />
- <property name="userDn" value="${userDn}" />
- <property name="password" value="${password}" />
- </bean>
ldap.properties文件:
url=ldap://61.xxx.xxx.xxx:389
base=o=mycom.com,c=cn
userDn=cn=root,o=mycom.com,c=cn
password=secret