Could you file this in JIRA? It would be extremely simple to implement if you're interested in digging in.
-----Original Message----- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Adrian Herscu Sent: Wednesday, September 07, 2005 6:15 AM To: [email protected] Subject: Re: [jelly] How to create maps Adrian Herscu wrote: > 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'}" /> > Another idea: <map var="myMap"> <item key="foo" value="the first string" /> <item key="moo" value="the second string" /> </map> But JEXL syntax is better since it allows the definition of collections in properties files. > Dion Gillard wrote: > >> Using the new tag? >> http://jakarta.apache.org/commons/jelly/tags.html#core:new >> >> On 9/7/05, Adrian Herscu <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
