空指针异常??
java.lang.NullPointerException
type Exception report
message An exception occurred processing JSP page /request.jsp at line 30
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /request.jsp at line 30
27: 用户�:<%=request.getParameter("username") %><br>
28: 爱好:<%
29: String[] favorites = request.getParameterValues("favorite");
30: for(int i=0;i<favorites.length;i++)
31: {
32: out.println(favorites[i]+" ");
33: }
代码如下
<body>
<h1>request内置对象</h1>
用户名:<%=request.getParameter("username") %><br>
爱好:<%
String[] favorites = request.getParameterValues("favorite");
for(int i=0;i<favorites.length;i++)
{
out.println(favorites[i]+" ");
}
%>