commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jamie Guillemette" <>
Subject [Configuration] save() not working?
Date Wed, 06 Apr 2005 17:17:09 GMT
In follow up to my message of this morning here is some sample code.


 * Created on Apr 6, 2005
package com.wirednorth.configdemo;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;

 * @author JMGuillemette
public class ConfigDemo {

 public ConfigDemo(){


 public void runDemo()throws ConfigurationException{
  URL url = this.getClass().getResource("/");
  PropertiesConfiguration config = new PropertiesConfiguration(url);
  String firstName = config.getString("name.first");

 public static void main(String[] args)throws Exception{
  ConfigDemo demo = new ConfigDemo();



the properties files it self looks like this...

name.first = jamie

name.last = guillemette

city = london

prov = ontario


if you run this code.. you would expect the first run through to product 
"jamie"on the console.. and the next one to produce "newName"... instead 
what i get is "jamie" every time.

Thanks again for all you help everyone :)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message