commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amnon Khen <amnon.k...@cash-u.com>
Subject RE: core:forEach collections
Date Tue, 16 Dec 2003 10:54:17 GMT
Hi,
Thanks for replying, however, I think my question wasn't understood as I
meant it (or maybe it as I who failed to explain it clearly).
I'm already familiar with <u:tokenize> and <j:forEach>. The collections
through which I need to iterate are not delimited lists, but Ant data
structures, such as FileSets or Paths.
Can it be done in a simple way?
Thanks,
	Amnon

______________________________________________________________________
Amnon Khen, Configuration Management, Cash-U Mobile Technologies LTD. 
Mobile: +972-(0)54-922394 / Office: +972-(0)9-8920815
mailto:amnon.khen@cash-u.com / http://www.cash-u.com
Israel - 45 Hamelacha St., P.O. Box 8617, New Industrial Zone, Netanya
36880, Israel / Tel: +972 9 8920888 
Europe - Argentum, 2 Queen Caroline St., Hammersmith, London W6 9DT, UK /
Tel: +44 20 8323 8066
Asia-Pacific -  47A Duxton Road, Singapore 089511 / Tel: +65 67322440
______________________________________________________________________
This e-mail message and its attachments are for the sole use of the intended
recipient(s), may contain confidential and/or privileged information and are
to  be regarded as confidential information under any non disclosure
agreement. Any review, use, disclosure or distribution by persons or
entities other than the intended recipient(s) is prohibited. If you are not
the intended recipient, please contact the  sender by reply and destroy all
copies of the original message and its attachments.
______________________________________________________________________


-----Original Message-----
From: Jörg Schaible [mailto:Joerg.Schaible@Elsag-Solutions.com] 
Sent: Tuesday, December 16, 2003 11:40
To: Jakarta Commons Users List
Subject: RE: core:forEach collections

Paul Libbrecht wrote on Tuesday, December 16, 2003 10:01 AM:

> To all that execpt core:forEach to accept such things as a
> string-with-separator, dare I suggest a work is done on a
> separate tag
> than forEach ?
> I do think forEach makes sense with collections and I do
> believe it is
> kind of sad to expect a collection out of a... string-object... so I
> would really prefer having something like core:forEachTokens
> with good
> attributes like the token-list, wether to go through tokens... and
> possibly with other attributes like token-family names (e.g. any
> whitespace, any character, any capital, as
> java.lang.Character offers).

It is the way it is specified in JSTL (1.0, chapter 6.1.1) anf therefore
something that is expected to work in this way. Admited, it is a convenience
enhancement, but looking at Jelly it is really much more fun to write:

<j:foreach var="i" items="a,b,c">
	<echo>${i}</echo>
</j:forEach>

than to introduce everytime an additional variable for nothing:

<u:tokenize var="i.split" delim=",">a,b,c</:u:tokenize>
<j:foreach var="i" items="${item.split}">
	<echo>${i}</echo>
</j:forEach>

especially since you often have comma-separated elements reading from a
property file.

http://jira.codehaus.org/secure/ViewIssue.jspa?key=JELLY-98
Already implements this including a test case.

Regards,
Jörg

---------------------------------------------------------------------
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