maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Giguere <eric.gigu...@videotron.ca>
Subject Re: dynamic property access
Date Fri, 29 Oct 2004 18:17:46 GMT
Ah, I see

I'm not sure if this is feasible...
One thing sure, you cannot put an expression in an expression ( 
${...${}}. It just does not work with jelly.
I've done a couple of tests with dynamic property names without success.

Eric.


Ben Anderson wrote:

>yes, that's a solution for the example I gave, but not what I'm looking for. 
>Let me give the real example:
>
>config.properties
>-----------------
>servername.qa=qaServer
>servername.prod=prodServer
>
>maven.xml
>---------
><u:properties var="props" file="config.properties"/>
><j:forEach var="prop" items="${props}">
>  <ant:copy file="${basedir}/WEB-INF/web.xml"
>            tofile="${build.dir}/WEB-INF/web.xml"
>            overwrite="true">
>    <ant:filterset>
>      <ant:filter token="servername" value="${servername.${env}}"/>
>
>
>actually, this is probably a bit much.  Is there a way to solve the original
>example w/out modifying the <j:set> tags?
>
>Thanks,
>Ben
>
>Quoting Eric Giguere <eric.giguere@videotron.ca>:
>
>  
>
>>Hello Ben
>>Yep, try this:
>>
>>    <j:set var="color" value="red"/>
>>    <j:set var="colorKey" value="${color}"/>
>>    <ant:echo>
>>        ${colorKey}
>>    </ant:echo>
>>
>>
>>Hope it helps
>>Eric.
>>
>>Ben Anderson wrote:
>>
>>    
>>
>>>Hi,
>>>I want to dynamically set which property I access.  Is this possible?
>>>Obviously the below code won't work, but you get the idea.  I thought
>>>maybe that the <j:expr> tag might help, but it doesn't seem to do
>>>anything.
>>>
>>>   <j:set var="color" value="red"/>
>>>   <j:set var="colorKey" value="color"/>
>>>   <ant:echo>
>>>       ${${colorKey}}
>>>   </ant:echo>
>>>
>>>Any ideas?
>>>
>>>Thanks,
>>>Ben
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>>
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>    
>>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>  
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message