DescriptionNOTE: JSP-TAG A Tag that sorts a List using a Comparator both passed in as the tag attribute. If 'id' attribute is specified, the sorted list will be placed into the PageContext attribute using the key specified by 'id'. The sorted list will ALWAYS be pushed into the stack and poped at the end of this tag. Parameters
ExamplesUSAGE 1: <ww:sort comparator="myComparator" source="myList"> <ww:iterator> <!-- do something with each sorted elements --> <ww:property value="..." /> </ww:iterator> </ww:sort> USAGE 2: <ww:sort id="mySortedList" comparator="myComparator" source="myList" /> <% Iterator sortedIterator = (Iterator) pageContext.getAttribute("mySortedList"); for (Iterator i = sortedIterator; i.hasNext(); ) { // do something with each of the sorted elements } %> |