You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Charles Crouch <ch...@hotmail.com> on 2004/02/09 00:06:14 UTC
[configuration] referencing properties across files bug/feature?
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 <ep...@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
RE: [configuration] referencing properties across files bug/feature?
Posted by Eric Pugh <ep...@upstate.com>.
Could you post a bug and attach your testcase? Boil the testcase down to
the simplest possible, and we'll add it to the c-configuration test suite..
Eric
> -----Original Message-----
> From: Charles Crouch [mailto:charles_crouch@hotmail.com]
> Sent: Monday, February 09, 2004 12:06 AM
> To: commons-dev@jakarta.apache.org
> Subject: [configuration] referencing properties across files
> bug/feature?
>
>
> 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 <ep...@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.HierarchicalDOM4JC
> onfiguration"
> fileName="tables.xml"/>
> <dom4j
> className="org.apache.commons.configuration.HierarchicalDOM4JC
> onfiguration"
> 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-c
onfiguration/.
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
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org