is it possible to set the value inside property file at runtime.
I tried this and it changes while reading property back, but when I check in file that changes are not reflected.
try {
Properties props = new Properties();
props.setProperty("ServerAddress", "ee");
props.setProperty("ServerPort", "123");
props.setProperty("ThreadCount", "456");
File f = new File("myApp.properties");
OutputStream out = new FileOutputStream( f );
props.store(out, "This is an optional header comment string");
System.out.println(props.get("ServerPort"));
out.close();
}
catch (Exception e ) {
e.printStackTrace();
}
output: 123.
my need is to have one property file application wide and through GUI web page that configuration can be change.