Specifying Environment Properties
You can specify environment properties to the JNDI by using the environment parameter to the InitialContext constructor
Application Resource Files
To simplify the task of setting up the environment required by a JNDI application, you may distribute application resource files along with application components and service providers. An application resource file has the name jndi.properties. It contains a list of key/value pairs presented in the properties file format (see java.util.Properties). The key is the name of the property (for example, java.naming.factory.object) and the value is a string in the format defined for that property.Here is an example of an application resource file.
java.naming.factory.object=com.sun.jndi.ldap.AttrsToCorba:com.wiz.from.Person java.naming.factory.state=com.sun.jndi.ldap.CorbaToAttrs:com.wiz.from.Person java.naming.factory.control=com.sun.jndi.ldap.ResponseControlFactory java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory java.naming.provider.url=ldap://localhost:389/o=jnditutorial com.sun.jndi.ldap.netscape.schemaBugs=true
Read full article from Specifying Environment Properties
No comments:
Post a Comment