Iterator的异常!
在eclipce中运行老出这个异常
exception
org.apache.jasper.JasperException:
An exception occurred processing JSP page /list.jsp at line 45
42: <td>删除</td>
43: </tr>
44: <%
45: Iterator iter = all.iterator() ;
46: while(iter.hasNext())
47: {
48: Cusinf cusinf = (Cusinf)iter.next() ;
Cusinf cusinf = (Cusinf)iter.next() ;
但是我用虚拟路径可以进入这个JSP页面,而且也不报错。。。
------解决方案--------------------46: while(iter.hasNext())
47: {
48: Cusinf cusinf = (Cusinf)iter.next() ;
Cusinf cusinf = (Cusinf)iter.next() ;
问题出在第二个iter.next();
当遍历到最后一个元素时 while(iter.hasNext())是true,进入循环
iter.next()指针下移一个,第二个iter.next()就取不到了,造成异常
我的异常网推荐解决方案:An exception occurred processing JSP page,http://www.myexception.cn/j2se/33144.html