2 u013719162 u013719162 于 2014.03.07 16:16 提问

Jsp org.apache.jasper.JasperException 都快崩溃了,大侠还有木有?

在网上找了一个程序,觉得不错,拿来学习一下,可出现了的异常,请大侠帮忙改一下,不胜感激
jsp代码如下:
<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="java.util.*"%>

用户名: 注销

<%
if(request.getParameter("name")!=null)
{
session.setAttribute("uname",request.getParameter("name")) ;
}
%>

在线人员


<%
List l = (List)application.getAttribute("alluser") ;
Iterator iter = l.iterator() ;
while(iter.hasNext())
{
%>

<%=iter.next()%>
<%
}
%>

异常如下:
org.apache.jasper.JasperException:An exception occured processing JSP page/online.jsp at line 37


<%
List l = (List)application.getAttribute("alluser") ;
Iterator iter = l.iterator() ;
while(iter.hasNext())
{
%>

<%=iter.next()%>
Stacktrace:
.....
root cause
java.lang.NullPointerException
org.apache.jsp.onlin_jsp._jspService(online_jsp.java:99)
......
Csdn user default icon
上传中...
上传图片
插入图片