1.分页查询时配置:
spring ldap配置:
<bean id="contextSource" class="org.springframework.ldap.transaction.compensating.manager.TransactionAwareContextSourceProxy">
<constructor-arg ref="pooledContextSource"/>
</bean>
<bean id="pooledContextSource" class="org.springframework.ldap.pool.factory.MutablePoolingContextSource">
<property name="contextSource" ref="contextSourceTarget"/>
<property name="dirContextValidator" ref="dirContextValidator"/>
<property name="testOnBorrow" value="true"/>
<property name="testWhileIdle" value="true"/>
<property name="minIdle" value="0"/>
<property name="maxIdle" value="8"/>
<property name="maxActive" value="8"/>
<property name="maxTotal" value="100"/>
<property name="maxWait" value="-1"/>
</bean>
<bean id="dirContextValidator" class="org.springframework.ldap.pool.validation.DefaultDirContextValidator"/>
<bean id="contextSourceTarget" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="url" value="ldap://127.0.01:389" />
<property name="userDn" value="cn=root,dc=testdata" />
<property name="password" value="12345"/>
<property name="pooled" value="false" />
</bean>
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
<constructor-arg ref="contextSource" />
</bean>
<bean id="testDataDao_LDAP" class="com.talkweb.mainSyn.dal.impl.TestDataDaoImpl">
<property name="ldapTemplate">
<ref bean="ldapTemplate" />
</property>
</bean>
非分页查询配置2:
<bean id="contextSourceTarget" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="url" value="ldap://127.0.01:389" />
<property name="userDn" value="cn=root,dc=testdata" />
<property name="password" value="12345" />
<property name="pooled" value="false" />
</bean>
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
<constructor-arg ref="contextSourceTarget" />
</bean>