Spring LDAP搜索查询 - 并过滤返回重复的响应

时间:2016-02-23 03:35:20

标签: spring ldap spring-ldap ldap-query spring-security-ldap

尝试按目录中的lastName搜索用户。使用以下查询

AndFilter andFilter = new AndFilter(); andFilter.append(new EqualsFilter(LDAPAttributeConstants.LAST_NAME,userInformation.getLastName())); 列出searchList = ldapTemplate.search(appContainer,andFilter.encode(),controls,new UserDetailsMapper());

获取同一用户的多个重复值作为响应。 Cheacked目录,只有一个这样的用户。如何停止返回的重复值?并且根本没有显示具有相同姓氏的其他用户...查询有问题......?..请帮助

例如回应得到: 0:{ " userId":" TestA123" " firstName":" abc" " lastName":" def" " emailId":" abcdef@gmail.com" " GUID&#34 ;:" B%25252525252525252525252525252525252525252525252525252525252FrkUA1%25252525252525252525252525252525252525252525252525252525252xQABAeKAziw%25252525252525252525252525252525252525252525252525252525253D%25252525252525252525252525252525252525252525252525252525253D" } - 1:{ " userId":" TestA123" " firstName":" abc" " lastName":" def" " emailId":" abcdef@gmail.com" " GUID&#34 ;:" B%25252525252525252525252525252525252525252525252525252525252FrkUA1%25252525252525252525252525252525252525252525252525252525252xQABAeKAziw%25252525252525252525252525252525252525252525252525252525253D%25252525252525252525252525252525252525252525252525252525253D" } - 2:{ " userId":" TestA123" " firstName":" abc" " lastName":" def" " emailId":" abcdef@gmail.com" " GUID&#34 ;:" B%25252525252525252525252525252525252525252525252525252525252FrkUA1%25252525252525252525252525252525252525252525252525252525252xQABAeKAziw%25252525252525252525252525252525252525252525252525252525253D%25252525252525252525252525252525252525252525252525252525253D" } - 3:{ " userId":" TestA123" " firstName":" abc" " lastName":" def" " emailId":" abcdef@gmail.com" " GUID&#34 ;:" B%25252525252525252525252525252525252525252525252525252525252FrkUA1%25252525252525252525252525252525252525252525252525252525252xQABAeKAziw%25252525252525252525252525252525252525252525252525252525253D%25252525252525252525252525252525252525252525252525252525253D" }

0 个答案:

没有答案