Can InitialDirContext read from a file?

Discussion in 'Java' started by laredotornado, Nov 30, 2009.

  1. Hi,

    Just as a Properties file is able to load in properties via an
    InputStream, I was wondering if InitialDirContext could load up
    environment entries from an XML file, specifically, one where the
    properties are stored like so ...

    <env-entry>
    <env-entry-
    name>myco.galc.capitol.tours.email.notification.subject</env-entry-
    name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>%s Capitol Tour Request</env-entry-value>
    </env-entry>

    I couldn't find anything in the API so wondered if there was a more
    creative way to do it. Thanks, - Dave
     
    laredotornado, Nov 30, 2009
    #1
    1. Advertising

  2. In article
    <>,
    laredotornado <> wrote:

    > Just as a Properties file is able to load in properties via an
    > InputStream, I was wondering if InitialDirContext could load up
    > environment entries from an XML file, specifically, one where the
    > properties are stored like so ...
    >
    > <env-entry>
    > <env-entry-
    > name>myco.galc.capitol.tours.email.notification.subject</env-entry-
    > name>
    > <env-entry-type>java.lang.String</env-entry-type>
    > <env-entry-value>%s Capitol Tour Request</env-entry-value>
    > </env-entry>
    >
    > I couldn't find anything in the API so wondered if there was a more
    > creative way to do it. Thanks, - Dave


    Would those differ from the ones determined by InitialContext?

    <http://java.sun.com/javase/6/docs/api/javax/naming/InitialContext.html>

    Just curious.

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, Nov 30, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doug
    Replies:
    3
    Views:
    4,404
    Bruce Barker
    Nov 4, 2005
  2. keithb
    Replies:
    2
    Views:
    8,051
    keithb
    Jun 7, 2006
  3. ferbar
    Replies:
    9
    Views:
    375
    Keith Thompson
    Sep 25, 2005
  4. Sreejith K
    Replies:
    24
    Views:
    1,067
    Sreejith K
    Mar 24, 2009
  5. Alex Dowad
    Replies:
    4
    Views:
    300
    Michel Demazure
    May 1, 2010
Loading...

Share This Page