jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tobr...@transolutions.net (O'brien, Tim)
Subject RE: A simple sort tag
Date Mon, 03 Feb 2003 19:43:19 GMT
Actually, there really is no reason other than the conceptual layout of the
example.

I used to think that this was a bad thing (procedural JSP), but I've
recently come around to the other side of this debate, the example could
just as well be since everything goes to the pageContext:

<myapp:planet type="gaseous-giant"/>

<collection:sort items="${planets}" property="distanceFromSun"
order="ascending"/>

<c:forEach var="planet" items="${planets}">
 Humans will soon fly through <c:out value="${planet.name}"/>'s
atmosphere<br/>
</c:forEach>

--------
Tim O'Brien 


> -----Original Message-----
> From: Henri Yandell [mailto:bayard@generationjava.com] 
> Sent: Monday, February 03, 2003 1:28 PM
> To: Tag Libraries Developers List
> Subject: Re: A simple sort tag
> 
> 
> 
> Any reason why the c:forEach is in the collection:sort?
> 
> Why not just make collection:sort be an atomic tag with no body?
> 
> Hen
> 
> On Mon, 3 Feb 2003, O'brien, Tim wrote:
> 
> > I frequently do this:
> >
> >   <myapp:planet type="gaseous-giant">
> >    <collection:sort items="${planets}" property="distanceFromSun" 
> > order="ascending">
> >     <c:forEach var="planet" items="${planets}">
> >      Humans will soon fly through <c:out value="${planet.name}"/>'s 
> > atmosphere<br/>
> >     </c:forEach>
> >    </collection:sort>
> >   <myapp:planet>
> >
> > I didn't see anything like this on Jakarta Taglibs, and 
> > commons-collections, commons-beanutils (esp. 
> BeanComparator) make this 
> > trivial. Forgive me if this is already a part of Taglibs.
> >
> > Here's the tag: http://cvs.apache.org/~tobrien/SortTag.java
> > and here's the TLD: http://cvs.apache.org/~tobrien/collection.tld
> >
> > I also see opportunity for a randomizer tag to take a 
> collection and 
> > scramble it.  This would be useful for lists of mirrors.
> >
> > --------
> > Tim O'Brien
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
> 
> 


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


Mime
View raw message