2009-07-24

struts HashMap iterate

 ArrayList arl=new ArrayList();
while(rs1.next()){
System.out.println("enter the loop");
HashMap map = new HashMap();
String name=rs1.getString("name");
String email=rs1.getString("email");
String phno=rs1.getString("phno");
map.put("NAME" , name);
map.put("EMAIL" , email);
map.put("PHNO", phno);
arl .add(map);
System.out.println(arl);
}
request.setAttribute("arll",arl);
 
 
 <logic:iterate id="person" name="arll">
<logic:iterate id="details" name="person" >
<bean:write name='details' property='key'/> 
<bean:write name='details' property="value" />
</logic:iterate>
</logic:iterate>

0 留言: