You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Peter Donald <pe...@realityforge.org> on 2003/04/10 05:10:45 UTC

Evaluating properties

Hi,

Someone wanna tell me how to do the following. I have some property files that 
look like

property1.properties
--------------------
myProp=1

property2.properties
--------------------
mySecondProp=${myProp}


I want to load both property files and have the second one resolved so that it 
is "mySecondProp=1". I though the following would work but it doesn't. ANyone 
know why?

<util:properties var="_data" file="property1.properties" />
<j:forEach items="${_data.keySet().iterator()}" var="_key">
  <j:set var="${_key}"><j:expr value="${_data.get(_key)}"></j:set>
</j:forEach>

<util:properties var="_data" file="property2.properties" />
<j:forEach items="${_data.keySet().iterator()}" var="_key">
  <j:set var="${_key}"><j:expr value="${_data.get(_key)}"></j:set>
</j:forEach>

-- 
Cheers,

Peter Donald
-------------------------------------------------------
To fight and conquer in all your battles is not supreme 
excellence; supreme excellence consists in breaking the 
enemy's resistance without fighting. - Sun Tzu, 300 B.C.
-------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org