2 Replies Latest reply on Oct 10, 2008 2:51 PM by Rajasekhar Devi Reddy

    best way to read in properties ?

    Rajasekhar Devi Reddy Newbie


      I read in a book that using Java IO and directly reading in a properties file is not good in case of EJBs or any web application that is supposed to be portable. So, If I have to use classloader, which of the following is a better option.

      1. in = ClassLoader.getSystemResourceAsStream("properties.properties");

      2. in = this.getClass().getClassLoader().getSystemResourceAsStream("properties.properties");

      3. in = Thread.currentThread.getClass().getClassLoader().getSystemResourceAsStream("properties.properties");

      will these work if I have my properties file in the jar file that is deployed to server.