
hi, i am not getting how to display this map values in jsp page using struts2
public class ViewOperation2 {
public Map<String,Object> viewCustDetails(){
Map<String, Object> m=new HashMap<String, Object>();
ViewAction2 v=null;
Connection dbconn=DatabaseConnection.connect();
try{
Statement stmt=dbconn.createStatement();
String sql="select * from customer1";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()){
v=new ViewAction2();
v.setId(rs.getString("id"));
v.setName(rs.getString("name"));
v.setAddress(rs.getString("address"));
v.setAge(rs.getString("age"));
m.put("map", v);
}
v.setMap(m);
}catch(Exception e){
e.printStackTrace();
}
return m;
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.