当前位置: 代码迷 >> J2SE >> apache.jasper.JasperException: An exception occurred processing JSP page /
  详细解决方案

apache.jasper.JasperException: An exception occurred processing JSP page /

热度:84   发布时间:2016-04-24 13:17:46.0
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.daimami.com/j2se/33144.html
  相关解决方案