Tag Name: <a2:append />

Description

Append the values of a list of iterators to one iterator

Component for AppendIteratorTag, which jobs is to append iterators to form an appended iterator whereby entries goes from one iterator to another after each respective iterator is exhausted of entries.

For example, if there are 3 iterator appended (each iterator has 3 entries), the following will be how the appended iterator entries will be arranged:

  1. First Entry of the First Iterator
  2. Second Entry of the First Iterator
  3. Third Entry of the First Iterator
  4. First Entry of the Second Iterator
  5. Second Entry of the Second Iterator
  6. Third Entry of the Second Iterator
  7. First Entry of the Third Iterator
  8. Second Entry of the Third Iterator
  9. Third Entry of the Third ITerator
public class AppendIteratorTagAction extends ActionSupport { private List myList1; private List myList2; private List 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"; } public List getMyList1() { return myList1; } public List getMyList2() { return myList2; } public List getMyList3() { return myList3; } } <a:append id="myAppendIterator"> <a:param value="%{myList1}" /> <a:param value="%{myList2}" /> <a:param value="%{myList3}" /> </a:append> <a:iterator value="%{#myAppendIterator}"> <a:property /> </a:iterator>

Attributes

Name

Required

Default

Type

Description

id false   Object/String the id of which if supplied will have the resultant appended iterator stored under in the stack's context

Back to Taglib Index