java对Ldap操作4
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="ldapSource" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="url" value="ldap://192.168.210.145:48023" />
<property name="base" value="dc=koal,dc=com" />
<property name="userName" value="cn=Directory Manager" />
<property name="password" value="adminadmin" />
</bean>
<!--
<property name="userName" value="uid=admin,ou=Administrators,ou=TopologyManagement,o=NetscapeRoot" />
<property name="password" value="admin" />
-->
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
<constructor-arg ref="ldapSource" />
</bean>
<bean id="userDao" class="ldap.imp.UserDaoLdapImpl">
<property name="ldapTemplate"><ref bean="ldapTemplate"/></property>
</bean>
</beans>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="ldapSource" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="url" value="ldap://192.168.210.145:48023" />
<property name="base" value="dc=koal,dc=com" />
<property name="userName" value="cn=Directory Manager" />
<property name="password" value="adminadmin" />
</bean>
<!--
<property name="userName" value="uid=admin,ou=Administrators,ou=TopologyManagement,o=NetscapeRoot" />
<property name="password" value="admin" />
-->
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
<constructor-arg ref="ldapSource" />
</bean>
<bean id="userDao" class="ldap.imp.UserDaoLdapImpl">
<property name="ldapTemplate"><ref bean="ldapTemplate"/></property>
</bean>
</beans>