commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam iam <>
Subject [configuration] Variable interpolation across files broken
Date Sun, 26 Feb 2012 08:19:55 GMT

Hi, With Commons Configuration 1.6, I was able to declare a variable in a properties file,
and then reference it in a XML file using the ${myvar} syntax. For example:
  <product name="abc">
  </link></product> config.xml-----<properties fileName=""/><xml
fileName="test.xml" config-name="test" validating="true">
  <expressionEngine config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
  <reloadingStrategy refreshDelay="5000" config-class="org.apache.commons.configuration.reloading.FileChangedReloadingStrategy"/>
When I try to retrieve the value, like so: combinedConfig.getConfiguration("test").configurationAt("products/product[@name='abc']",
true).getString("desc") I get "${myvar}-product" instead of "abc-product". This was working
in Commons Configuration 1.6, but seems to be broken in 1.7 and 1.8. Did something change,
or is there a different way to do this? Or is this a bug?  		 	   		  
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message