<bean id="idsContextSource" class="org.springframework.ldap.support.LdapContextSource">
<property name="urls" value="${idsurl}" />
<property name="base" value="${idsbase}" />
<property name="userName" value="${idsuserName}" />
<property name="password" value="${idspassword}" />
<property name="dirObjectFactory" value="org.springframework.ldap.support.DefaultDirObjectFactory" />
</bean>
<bean id="idsLdapOperations" class="org.springframework.ldap.LdapTemplate">
<constructor-arg ref="idsContextSource" />
</bean>最好每一个标签前面加一句注解
<property name="urls" value="${idsurl}" />
<property name="base" value="${idsbase}" />
<property name="userName" value="${idsuserName}" />
<property name="password" value="${idspassword}" />
<property name="dirObjectFactory" value="org.springframework.ldap.support.DefaultDirObjectFactory" />
</bean>
<bean id="idsLdapOperations" class="org.springframework.ldap.LdapTemplate">
<constructor-arg ref="idsContextSource" />
</bean>最好每一个标签前面加一句注解
<!--定义了一个名称为idsContextSource的LdapContextSource实例-->
<bean id="idsContextSource" class="org.springframework.ldap.support.LdapContextSource">
<!--这个类中为以下了几个属性进行赋值,也就是通过设置注入-->
<property name="urls" value="${idsurl}" />
<property name="base" value="${idsbase}" />
<property name="userName" value="${idsuserName}" />
<property name="password" value="${idspassword}" />
<property name="dirObjectFactory" value="org.springframework.ldap.support.DefaultDirObjectFactory" />
</bean>
<!--定义了一个名称为idsLdapOperations的LdapTemplate实例
这个类通过构造函数进行注入-->
<bean id="idsLdapOperations" class="org.springframework.ldap.LdapTemplate">
<constructor-arg ref="idsContextSource" />
</bean>