先发代码:
<%
List<Student> stus =(List<Student>) request.getAttribute("abc") ;
Iterator<Student> iter=stus.iterator(); //迭代所有学生while(iter.hasNext())   
{
   Student stu=iter.next(); 
%>
<tr>
<td>
 <input type="checkbox" name="t" value="?"/>
 </td>
 <td><%=stu.getId()%></td>
 <td><%=stu.getName() %></td>
 <td><%=stu.getPaw() %></td>
 </tr>
 <%
 }
 %>
红色的老报错:Iterator cannot be resolved to a type
我就是想把abc中的数据显示在jsp页面上,循环为什么不行? 新手上路,跟高手请教请教
下边是我要显示的数据:
public class VMDB {
static List<Student> stus = new ArrayList<Student>();

static {
stus.add(new Student(1,"刘睿","1234"));
stus.add(new Student(1,"刘睿","1234"));
stus.add(new Student(1,"刘睿","1234"));
stus.add(new Student(1,"刘睿","1234"));
stus.add(new Student(1,"刘睿","1234"));
stus.add(new Student(1,"刘睿","1234"));
stus.add(new Student(1,"刘睿","1234"));
stus.add(new Student(1,"刘睿","1234"));
stus.add(new Student(1,"刘睿","1234"));
stus.add(new Student(1,"刘睿","1234"));
}
我通过public static List<Student> findAll(){
return stus;
}把数据传到了req.setAttribute("abc",VMDB.findAll() );JSPIterator错误