空指針異常??
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]+" ");
? ? }
? ? %>
2017-04-25
你是不是頁面跳轉前在愛好選項上沒有勾選