commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantinos Pachopoulos <kostaspa...@yahoo.gr>
Subject configuration-Properties: cannot define a property based upon another one
Date Sat, 22 Dec 2007 13:11:09 GMT
Hi,
Given a properties file, which contains this:
-------------------
b = asd
a = ${b}safk
-------------------
I -when reading property 'a'- get "${b}safk".

This is the program i use for reading the properties:
---------------------
import java.io.*;
import org.apache.commons.configuration.*;

public class PropsTest 
{
    public static void main(String[] args)
    {
        PropertiesConfiguration props_=new
PropertiesConfiguration();
        try {
            props_.load(new FileReader("C:/Documents
and Settings/paxosk/My Documents/a.props"));
        }
        catch(Exception e) {
            System.err.println("failed to parser
properties file... exiting/n"+
                    e.getMessage());
            System.exit(-1);
        }        
        
       
System.out.println((String)props_.getProperty("a"));  
     
    }//main
}
--------------------

What's the problem?

Thanks


      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message