Previous | Next | Trail Map | Beyond the Basics | Contents

Environment Properties

In the Preparations (in the Basics trail) lesson, you saw how to set up a Hashtable object, populate it with some properties, and then use it as a parameter to the InitialContext constructor(in the API reference documentation) . Here is an example:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, 
    "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://localhost:389/o=JNDITutorial");

Context ctx = new InitialContext(env);
In fact, almost every example you have seen in this book has used a similar pattern. The data in the Hashtable is called environment properties, or simply environment. The use of the Hashtable as shown is but one way of specifying environment properties.

This lesson describes in detail what exactly are environment properties, where they come from, and how they are used by the JNDI. This lesson also describes how to update environment properties and how to customize a service provider using properties.


Previous | Next | Trail Map | Beyond the Basics | Contents