cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject Re: Handling Iterators in JXTG
Date Wed, 21 Apr 2004 19:45:46 GMT
Leszek Gawron wrote:

>Am I wrong or there is no way to handle iterators in JXTG? One can use forEach
>for collections but I sometimes would like to pass and iterator to a view to
>process larger result sets.
>
>In Hibernate you can:
>
>var list = session.createQuery("from LargeTable").list() which creates a whole
>collection at once but you can also do:
>
>var iterator = session.createQuery("from LargeTable").iterate() which makes
>generating view much less memory consuming.
>
>Maybe something like:
><jx:while test="${it.hasNext()}">
>	<jx:set car="current" value=${it.next()}/>
>	${current.value}<br/>
></jx:while>
>
>The syntax is ugly I know but after a little tuning it would be very useful.
>	lg
>  
>
<jx:forEach> should work on Iterators (as well Enumerations):

sendPage("page.html", {iteration: session.createQuery("from 
LargeTable").iterate()});

<jx:forEach var="current" items="${iteration}">
     ${current.value}</br>
</jx:forEach>


Chris

Mime
View raw message