hi all,
i need help rendering an ArrayList of HashMaps.
Problem:
I created a ArrayList of HashMaps in the action class and set it in session. Now i need to display it in the JSP. i tried all the taglib options was not able to do it.
Using scriplets i could do it.... here is the scriptlet code....
=====================================
<%
//Array list for getting the arraylist from the session
java.util.ArrayList arrlist = new java.util.ArrayList();
arrlist=(java.util.ArrayList)session.getAttribute("resultList");
//HashMap to take the hashmap from the arraylist
java.util.HashMap hash = new java.util.HashMap();
int i, arraysize,hashsize;
Object transactionId;
java.util.Set keys;
java.util.Iterator iter;
if(arrlist!=null)
{
i=0;
//Calculating the size of the arraylist to control the execution
arraysize=arrlist.size();
if(arraysize == 0)
{
%>
<%
}else{
System.out.println(arraysize);
//Iterator to iterate throught the arraylist
java.util.Iterator iterator = arrlist.iterator ();
%>
Txn ID |
Txn GUID |
Date |
Type Of Activity |
Status code |
<%
while(iterator.hasNext()&& (arraysize>0)){
//getting the hashmap from the arraylist and extracing the information to display in the table
hash = (java.util.HashMap)arrlist.get(i);
hashsize=hash.size();
keys = hash.keySet();
iter= keys.iterator();
i++;
arraysize--;
transactionId=hash.get("ID");
%>
"><%=transactionId%> |
<%=hash.get("TRNXN_GUID")%> |
<%=hash.get("TRNXN_DATE")%> |
<%=hash.get("DB_TRNXN_TYPE_ID")%> |
<%=hash.get("TRNXN_STAT")%> |
<%
}
session.setAttribute("resultList",null);
// For making the checkbox clicked default and the default value is "Today"
%>
<%
}
}
else{} %>
==================================================
now how can i do the same with taglibs. i mean some thing like inside ..i guess.
please help.