我正在尝试使用spring-ldap从ldap中读取值。
我正在尝试执行基于文档http://docs.spring.io/spring-ldap/docs/current/reference/#basic-queries的ldap查询。
我的程序无法编译,因为找不到LdapQuery。
LdapQuery query = query()
.base("dc=261consulting,dc=com")
.attributes("cn", "sn")
.where("objectclass").is("person")
.and("sn").is(lastName);我的pom.xml有以下条目。
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>1.3.1.RELEASE</version>
</dependency>我在http://docs.spring.io/spring-ldap/site/apidocs/index.html上查看了spring-ldap api文档,它们似乎没有spring类。
您能帮助一下如何使用spring从ldap中读取值吗?如果你能提供一个例子,那就太好了。
谢谢
发布于 2016-07-29 01:36:24
LdapQuery是在2.0版本中添加的。如果您只能使用较早的版本,请考虑使用LdapTemplate。
https://stackoverflow.com/questions/38642338
复制相似问题