我有一个 Struts2 Action 类
有getter/setterjava.util.List list;
但我不知道它的泛型List<?> list;
我这里有代码:
public class Test
{
private List list;
public List getList() {
return list;
}
public void setList(List list) {
this.list = list;
}
public String execute()throws Exception
{
for(int i=0;i<list.size();i++)
{
//how can print here list
// in this situation i have List<Detail> list
// filed is id ,username,password
// but i want to print dynamically get class name and then filed name and then print list
}
}
}