楼主要是有个List的话参考下我写的
List l=new List;
Iterator i=l.iterator();
while(i.hasNext)
{
   out.print(i.next());
}这样是遍历list最好方法楼主请参考

解决方案 »

  1.   

    谢谢楼上。 
     可能是我的意思没表达清楚。
      就是说那个LIST可能是USER表 也有可能是STUDENT表。
       我要把表LIST里面的东西 取出来。打印到JSP界面上。
      例如LIST  可能有id name等。
      List l=new List;
    Iterator i=l.iterator();
    while(i.hasNext)
    {
       out.print(i.next());
    }
    好像只能得到对象名吧? 但是我要取到对面里面的值。。 
      

  2.   

    那就是这样就可以了:List l=new List;
    Iterator i=l.iterator();
    while(i.hasNext)
    {
       User u=(User)i.next();//强制转换下
       out.print(u.getXX());
    }这样肯定行
      

  3.   

    - -!分给你吧。
     朋友你把QQ给我吧。3Q