ldap:ldapserver, references a Spring bean with the ID,
ldapserver bean may be defined as follows:
<bean id="ldapserver" class="javax.naming.directory.InitialDirContext" scope="prototype"> <constructor-arg> <props> <prop key="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</prop> <prop key="java.naming.provider.url">ldap://localhost:10389</prop> <prop key="java.naming.security.authentication">none</prop> </props> </constructor-arg> </bean>
The preceding example declares a regular Sun based LDAP
connects anonymously to a locally hosted LDAP server.
DirContext objects are not required to support concurrency by contract. It is
therefore important that the directory context is declared with the setting,
scope="prototype", in the
bean definition or that the context
supports concurrency. In the Spring framework,
prototype scoped objects are
instantiated each time they are looked up.