0
Iterator<Entry<String, HashMap<String, List<String>>>> 
iter=cellLinesList.entrySet().iterator();

    while(iter.hasNext()){
        Entry en=iter.next();
        System.out.println("The bay is ................"+en.getKey());
        HashMap<String,List<String>> rowList=(HashMap<String, List<String>>) en.getValue();
        Iterator<Entry<String, List<String>>> rowIter=rowList.entrySet().iterator();
        while(rowIter.hasNext()){
            Entry rowEn=rowIter.next();
            System.out.println("The row is ..................."+rowEn.getKey());
            List<String> cellsList=(List<String>) rowEn.getValue();
            for(String s:cellsList){
                System.out.println(s);
            }
        }
    }

Here I am unable to iterator this type of the Hashmap,Please help me

Thanks in advance

Shiva kumar
  • 13
  • 1
  • 4

1 Answers1

0

Traversing these structures is generally easier in JSP than in Java, thanks to iterators doing most of the job for you.

For example, this answer explains exactly how to iterate the structure:

HashMap<String,<ArrayList<String>>> 

By the way, in some cases the (lack of) design reaches a point where a refactoring is higly suggested.

This:

Iterator<Entry<String, HashMap<String, List<String>>>> 

is quite a nightmare to handle; try creating some objects like described in this other answer.

Community
  • 1
  • 1
Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243