DescriptionComponent for MergeIteratorTag, which job is to merge iterators and successive call to the merged iterator will cause each merge iterator to have a chance to expose its element, subsequently next call will allow the next iterator to expose its element. Once the last iterator is done exposing its element, the first iterator is allowed to do so again (unless it is exhausted of entries). Internally the task are delegated to MergeIteratorFilter Example if there are 3 lists being merged, each list have 3 entries, the following will be the logic.
Parameters
Examplespublic class MergeIteratorTagAction extends ActionSupport { private List myList1; private List myList2; private List myList3; public List getMyList1() { return myList1; } public List getMyList2() { return myList2; } public List getMyList3() { return myList3; } public String execute() throws Exception { myList1 = new ArrayList(); myList1.add("1"); myList1.add("2"); myList1.add("3"); myList2 = new ArrayList(); myList2.add("a"); myList2.add("b"); myList2.add("c"); myList3 = new ArrayList(); myList3.add("A"); myList3.add("B"); myList3.add("C"); return "done"; } } <ww:merge id="myMergedIterator1"> <ww:param value="%{myList1}" /> <ww:param value="%{myList2}" /> <ww:param value="%{myList3}" /> </ww:merge> <ww:iterator value="%{#myMergedIterator1}"> <ww:property /> </ww:iterator> |