0 Replies Latest reply on Nov 3, 2004 9:41 AM by olihenning

    How to place simple Strings/Integers etc. in JNDI

    olihenning

      Hello together

      how can i define a simple Value (String, Integer, Char, Short etc.) in the JNDI Tree. But the Value shall not be packaged in an EAR/WAR/EJB-jar. The Server Administrator shall be responsible for that value, and he must not change values in the Deployment-Package.

      In other Words i need somthing like this:
      In the EJB:

      Context ctx=new InitialContext();
      String cfg=(String)ctx.lookup("java:comp/env/MyConfigKey");
      

      In ejb-jar.xml:
      <resource-env-ref>
       <description>Admin, give me a String here please</description>
       <resource-env-ref-name>MyConfigKey</resource-env-ref-name>
       <resource-env-ref-type>java.lang.String</resource-env-ref-type>
      </resource-env-ref>
      

      And the rest shall be only somewhere in the Server-Config, but not in the EAR, because the Value is only known by the Server-Admin.

      In Tomcat the Server-Admin can simply place a Element within a Element in the central server.xml-Config-File to propagate such simple values to the Application.

      THX for helping me.
      Oli Henning