JNDI Section Index | Page 2
How can I use LDAP with JSP?
To use LDAP within Java (JSP or not), you must use JNDI (Java Naming and Directory Interface).
A bit like JDBC, JNDI consists of
A list of packages: javax.naming, javax.naming.directory, javax....more
How can I obtain a JNDI Context from inside an applet?
To get an initial context from an applet, you need to pass the InitialContext constructor a Hashtable with the Context.APPLET property ("java.naming.applet") set:
Hashtable hash = new H...more
When using JNDI with LDAP, how can I get the DN (Distinguished Name) from a DirContext?
If you get the DN for a DirContext you have to use the method, getNameInNamespace(). This method retrieves the full name of this context within its own namespace. For example:
DirContext ctx...more
How can I configure JNDI to use SSL to connect to an LDAP server?
Check out Sun's JNDI Tutorial's Security chapter, particularly the SSL and Custom Sockets section.more
Can I have my JSP container access JSP pages which are not present in a local file system by doing a JNDI lookup?
There is nothing in the specification that would prevent you from doing this. The specification defines how requests should get mapped to resources, the syntax and API for JSPs and servlets, and ...more
Are there any complete JNDI service provider (SPI) examples that use federation?
Hmm... I don't know if this is "complete" enough for you or not but as part of the
Building a Service Provider section of Sun's JNDI API Tutorial and Reference there is a lesson which co...more
Where can I get a JNDI provider for NetWare?
You can pick this up with the rest of the Novell Class Libraries for Java from the Novell Developer Portal.
How does one abandon a directory search before completion?
To cancel a search, you simply need to close the NamingEnumeration that is returned from the context.search() method.
NamingEnumeration enum = ctx.search( "ou=People", attributes );
if ...more
Where can I find the API documentation of the Java Naming and Directory Interface (JNDI)?
They are available from Sun's J2EE API documentation page.
When (manually) deploying an EJB where do you specify the JNDI name that the bean is bound to in the JNDI tree?
When (manually) deploying an EJB where do you specify
the JNDI name that the bean is bound to in the JNDI
tree?
How do I create an authenticated session to an LDAP server?
The authentication is provided when you create the InitialDirContext. Take a look at the snippet below...
private Hashtable _env = new Hashtable();
private InitialDirContext _ctx = null;
// Au...more
How do I use JNDI to locate the home interface of an EJB running on a different host? My client's InitialContext doesn't seem to know where the server is.
This depends on which EJB container / JNDI implementation that you are using.
For example, in WebLogic, you set the javax.naming.Context.PROVIDER_URL property to be the host and port, for example...more
What special characters do I have to encode for an LDAP name?
For LDAP providers, you must encode a space character at the beginning or end of the string, a sharp ("#") character at the beginning of the string, and all of: """, "...more
How can I use a database connection pool within a servlet or JSP page?
If you are using a J2EE Server, you should be able to access a connection pool via JNDI and retreive the a connection. If you are not using a J2EE Server, you can download (or write) a connection...more
What is LDAP (Lightweight Directory Access Protocol)?
LDAP is the "Lightweight Directory Access Protocol" and is defined by RFC 2251. Very
basically, LDAP is a simpler take on the X.500 directory access
protocol.
more