You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Petr Suchomel <ps...@itsignet.cz> on 2000/07/14 08:45:25 UTC

Help with InitialContext

Is it possible to use i Tomcat 3.1 objects from JNDI like InitialContext and so on
as described in taglib tutorial on server
http://www.orionserver.com/taglibtut/lesson6/
My focus is on configuration part which is putted to web.xml file
  <env-entry>

    <description>A test value</description>
    <env-entry-name>test</env-entry-name>
    <env-entry-value>HelloWorld</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>

  </env-entry>

  and is loaded by
  try{

    InitialContext context=new InitialContext();
    Object obj=(Object)context.lookup("java:comp/env/"+name);
    }catch(javax.naming.NamingException ne){

    throw new JspException(ne.getMessage()); 
  }


Re: Help with InitialContext

Posted by Petr Suchomel <ps...@itsignet.cz>.
Thanks for reply

In which version do you suppose this option will be included?

Petr
  ----- Original Message ----- 
  From: Craig R. McClanahan 
  To: general@jakarta.apache.org 
  Sent: Friday, July 14, 2000 6:26 PM
  Subject: Re: Help with InitialContext


  At the moment Tomcat does not include a JNDI-compatible InitialContext, and it ignores the presence of <env-entry> (as well as <resource-ref> and <ejb-ref>) tags in your web.xml file.  At least for <env-entry> and <resource-ref> this is something I would like to change in the next major version of Tomcat. 
  Craig McClanahan 
    

  Petr Suchomel wrote: 

    Is it possible to use i Tomcat 3.1 objects from JNDI like InitialContext and so onas described in taglib tutorial on serverhttp://www.orionserver.com/taglibtut/lesson6/My focus is on configuration part which is putted to web.xml file 
      <env-entry> 
        <description>A test value</description> 
        <env-entry-name>test</env-entry-name> 
        <env-entry-value>HelloWorld</env-entry-value> 
        <env-entry-type>java.lang.String</env-entry-type>
      </env-entry>
      and is loaded by
      try{ 
        InitialContext context=new InitialContext(); 
        Object obj=(Object)context.lookup("java:comp/env/"+name);
        }catch(javax.naming.NamingException ne){
        throw new JspException(ne.getMessage());
      }

Re: Help with InitialContext

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
At the moment Tomcat does not include a JNDI-compatible InitialContext,
and it ignores the presence of <env-entry> (as well as <resource-ref>
and <ejb-ref>) tags in your web.xml file.  At least for <env-entry> and
<resource-ref> this is something I would like to change in the next
major version of Tomcat.

Craig McClanahan


Petr Suchomel wrote:

> Is it possible to use i Tomcat 3.1 objects from JNDI like
> InitialContext and so onas described in taglib tutorial on
> serverhttp://www.orionserver.com/taglibtut/lesson6/My focus is on
> configuration part which is putted to web.xml file
>
>      <env-entry>
>           <description>A test value</description>
>           <env-entry-name>test</env-entry-name>
>           <env-entry-value>HelloWorld</env-entry-value>
>           <env-entry-type>java.lang.String</env-entry-type>
>      </env-entry>
>
>      and is loaded by
>
>      try{
>           InitialContext context=new InitialContext();
>           Object obj=(Object)context.lookup("java:comp/env/"+name);
>           }catch(javax.naming.NamingException ne){
>           throw new JspException(ne.getMessage());
>      }
>