hello,
 
   i have a situation here:

  
i want that i can change my property file dynamically without
   restarting Tomcat.

   i tried implementing it using the suggestion that was given to me by
   some of the people here which is to place the property file on the
   WEB-INF/classes directory and read it using this statement:

      Properties oProp = new Properties();
      oProp.load(this.getClass().getResourceAsStream
                         ("/CommandServer.properties")';
    this works fine. but the problem is when i change the property
    file dynamically while tomcat is running my changes doesn't take
    effect. the same default value was read.

    so, what i did was i make use of the File class to read the property
    file and implement it like this:

         File ofile = File ("..\\webapps\\myapp\\WEB-INF\\classes\\
                                com\\test\\MyProperty.properties");
         FileInputStream oIn = new FileInputStream(oFile);
         Properties oProp = new Properties();
         oProp.load(oIn);

    this also works, and i am able to change my property file dynamically.

    my question is, how do i place my property file so that when i read
    it using File class i don't have to include the
    "..\\webapps\\myapp\\WEB-INF\\classes" extra path...instead just read
    it directory from my package directory structure.

    is there a way Tomcat can read my property file that way?

 thanks in advance
   randie

Reply via email to