public
class
Iterator
extends
ActionSupport
{
Map nmap =
new
HashMap<String, List<Person>>();
public
String execute()
{
Person objPerson =
new
Person();
objPerson.userName =
"Name1"
;
objPerson.age =
25
;
List<Person> myList =
new
ArrayList<Person>();
myList.add(objPerson);
nmap.put(
"Mugil"
, myList);
objPerson.userName =
"Name2"
;
objPerson.age =
26
;
List<Person> myList2 =
new
ArrayList<Person>();
myList2.add(objPerson);
nmap.put(
"Mani"
, myList2);
objPerson.userName =
"Name3"
;
objPerson.age =
27
;
List<Person> myList3 =
new
ArrayList<Person>();
myList3.add(objPerson);
nmap.put(
"Vinu"
, myList3);
setNmap(nmap);
return
SUCCESS;
}
public
Map getNmap()
{
return
nmap;
}
public
void
setNmap(Map nmap)
{
this
.nmap = nmap;
}
}