Some one mentions about putting these infos into the web.xml configuration
file. I like the idea so I'm going to try it out. :)

Tung

-----Original Message-----
From: Eric Richardson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 23, 2000 7:45 AM
To: Orion-Interest
Subject: Re: Look up a EJB from a JSP?


Hi,
The first two properties should be able to be put in a properties file such
as
jndi.properties
usually on the classpath(maybe in the jre/lib directory). This can be read
by
the system by the "InputStream Classloader.getResouceAsStream()" method.
Orion
should allow for setting this for the system if it's not already loaded for
the client program. You should not have to write this code unless
you want the PROVIDER_URL to be dynamic and not from a property file.

The second two need to be set at runtime coming from the client program as
input.

Hope this helps,
Eric :-)


Tung Bui wrote:

> Hi, as part of my learning, I tried to implement a dynamic page as follow:
> JSP<->Java Bean<->EJB<->JDBC. I got it works as intended however with a
> hack. Within the my Java Bean, in order to look up the EJB bean
> successfully, I have to hard code the context info as follow:
>     Hashtable env = new Hashtable();
>     env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.evermind.server.ApplicationClientInitialContextFactory");
>     env.put(Context.PROVIDER_URL,"ormi://localhost/linkcontent");
>     env.put(Context.SECURITY_PRINCIPAL,"xxxx");
>     env.put(Context.SECURITY_CREDENTIALS,"xxxx");
>     Context ctx = new InitialContext(env);
> Which is not an ideal way. I'm having trouble from figuring out how to set
> these information up so that I do not have to hard code this way. Any
idea?
>
> Thanks,
> Tung


Reply via email to