Hi,
Can some one please help me with pagination problem?
I know how to implement pagination in my
jsp pages using arraylist and loop through the resultset.
for (int i = offset.intValue(),l = Math.min(i + maxPageItems, list.size());i < l; i++)
But for one of my application I am getting data from database and storing it into a hash Map using linked list.
I want to implement pagination in jsp page . But I don't know how to do pagination for Collection and is to iterate through each element . Can some one please help me with this.
This is how my code looks right now
List list= null;
HashMap hMap = null;
if(session.getAttribute("RESULT") != null)
{
hMap =(HashMap) session.getAttribute("RESULT");
list = new ArrayList(hMap.keySet());
if(list.size() != 0)
{
for(Iterator iterator = list.iterator();iterator.hasNext();)
{
if(iterator.hasNext())
{
String name = (String)iterator.next();
LinkedList result1 = (LinkedList)hMap.get(name);
DataBean db = (DataBean)result1.get(0);
for (int i=0; i<result1.size() ; i++)
{
db = (DataBean)result1.get(i);
}
}
}
}
}
Gurus please help me.
Thanks,
Maria