commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Crouch <charles_cro...@hotmail.com>
Subject [configuration] referencing properties across files bug/feature?
Date Sun, 08 Feb 2004 23:06:14 GMT
Thanks for the reply Eric.
I read through 
http://jakarta.apache.org/commons/configuration/examples.html?
but it didn't seem to address the variable interpolation/substitution 
issue that I described in my post below. I definitely need some sort of 
override behaviour but the examples say that the <override> tags are 
optional, so I think the syntax of my propertiesConfiguration.xml is 
correct.

I also got HEAD from cvs on Friday and ran my testcase again, still 
behaves as I described below.

Any further thoughts about what I can do/look at?
Thanks
Charles
 
-----------------------------------------------------------------------

From: Eric Pugh <epugh@upstate.com>
Subject: [configuration] referencing properties across files bug/feature?
Date: Fri, 30 Jan 2004 19:31:38 +0100
Content-Type: text/plain;
    charset="iso-8859-1"

Did you read the section here:
http://jakarta.apache.org/commons/configuration/examples.html?

The latest version has been reworked to make overrides simpler to do.  Here
is the guts:

<configuration>
  <override>
    <properties fileName="usergui.properties"/>
    <dom4j fileName="gui.xml"/>
  </override>

  <additional>
    <dom4j
className="org.apache.commons.configuration.HierarchicalDOM4JConfiguration"
     fileName="tables.xml"/>
    <dom4j
className="org.apache.commons.configuration.HierarchicalDOM4JConfiguration"
     fileName="tasktables.xml" at="tables"/>
  </additional>
</configuration>

Notice the <override> versus <additional>?

Also, check out one of the nightly builds from here:
http://cvs.apache.org/builds/jakarta-commons/nightly/commons-configuration/.

Eric

 > -----Original Message-----
 > From: Charles Crouch [mailto:charles_crouch@hotmail.com]
 > Sent: Friday, January 30, 2004 6:49 PM
 > To: commons-dev@jakarta.apache.org
 > Subject: [configuration] referencing properties across files
 > bug/feature?
 >
 >
 > Hello,
 > I have a question regarding referencing properties across different
 > property files. I've tried using both
 > commons-configuration-20030706.202021.jar and
 > commons-configuration-20040121.140929.jar. The setup I have is the
 > following:
 >
 > config-override.properties
 >     baseURL=http://localhost:9080
 >
 > config-default.properties
 >     baseURL=http://localhost:80
 >     servletURL=${baseURL}/servlet
 >
 > propertiesConfiguration.xml
 >     <configuration>
 >       <properties
 > className="org.apache.commons.configuration.PropertiesConfiguration"
 > fileName="config-override.properties"/>
 >       <properties
 > className="org.apache.commons.configuration.PropertiesConfiguration"
 > fileName="config-default.properties"/>
 >     </configuration>
 >
 >
 > When I call configuration.getString("servletURL") I get
 > http://localhost:80/servlet, but what I want is
 > http://localhost:9080/servlet.
 > Is this a bug or a feature? Is there anyway I can achieve the
 > behavior
 > I'm after?
 >
 > Thanks very much.
 > Charles
 >
 > ---------------------------------------------------------------------
 > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
 > For additional commands, e-mail: commons-dev-help@jakarta.apache.org


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


Mime
View raw message