commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Herscu <bmf1...@axentra.net>
Subject Re: [jelly] How to create maps
Date Wed, 07 Sep 2005 10:03:00 GMT
Thought that there is some special JEXL syntax that allows the creation 
of collections, arrays and lists.

So instead of:
     <new var="myMap" className="java.util.HashMap" />
     <expr value="${myMap.put('foo', 'the first string')}" />
     <expr value="${myMap.put('moo', 'the second string')}" />

one could write:
     <set var="myMap" value="${foo:'the first string',moo:'the second 
string'}" />

Dion Gillard wrote:
> Using the new tag?
> http://jakarta.apache.org/commons/jelly/tags.html#core:new
> 
> On 9/7/05, Adrian Herscu <bmf1972@axentra.net> wrote:
> 
>>Hi all,
>>
>>I know how to access a map in Jelly.
>>
>>     <forEach
>>         var="iter"
>>         items="${map}">
>>         ${iter.key} = ${iter.value}
>>     </forEach>
>>
>>But, how can I create a map using Jelly syntax?
>>
>>Thanks,
>>Adrian.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
> 
> 
> 


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


Mime
View raw message