Hello all,
I am trying to read and write to a property file residing in the WEB-INF folder. I was sucessful in reading the file. I am also partially sucessful writing to this file. The problem i am facing is, not being able to replace the same propery file in WEB-INF folder dynamically. I am wondering if this is possible to do so.
Please have a glance at my method below. The below code is generating a new file SequentialNumber.properties on the root directory of my application Server. I am wondering if there is some way to commit changes to the property file inside my WEB-INF folder.
Thanks all
public void setSequentialNum(
String Num)
{
Properties p = new Properties();
p.setProperty("SequentialNum",Num);
try {
//ClassLoader cl = ClassLoader.getSystemClassLoader();
p.store(new FileOutputStream("SequentialNumber.properties"),null);
} catch (IOException ioe) {
System.out.println("error Saving properties file: " + ioe);
}
}