Ok, I've tried web.xml, orion-web.xml without any luck. Anyone tried this
and made it work? Please help! Here is my web.xml looks like:

<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
        <!-- A demo servlet, add servlets below -->
        <servlet>
                <servlet-name>snoop</servlet-name>
                <servlet-class>SnoopServlet</servlet-class>
        </servlet>
        <context-param>
                <param-name>java.naming.factory.initial</param-name>
        
<param-value>com.evermind.server.ApplicationClientInitialContextFactory</par
am-value>
        </context-param>
        <context-param>
                <param-name>java.naming.provider.url</param-name>
                <param-value>ormi://localhost/linkcontent</param-value>
        </context-param>
        <context-param>
                <param-name>java.naming.security.principal</param-name>
                <param-value>admin</param-value>
        </context-param>
        <context-param>
                <param-name>java.naming.security.credentials</param-name>
                <param-value>admin</param-value>
        </context-param>
</web-app>

Tung

-----Original Message-----
From: Tung Bui [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 23, 2000 11:47 AM
To: Orion-Interest
Subject: RE: Look up a EJB from a JSP?


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