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>

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章