当没选择checkbox的时候老师的代码成功进入循环体,我改了个顺序就报错了
-----------------------------------------------
String[] isUseCookies = request.getParameterValues("isUseCookie");
if(isUseCookies!=null&&isUseCookies.length>0)
老师写的成功了
-----------------------------------------------
String[] isUseCookies = request.getParameterValues("isUseCookie");
if(isUseCookies.length>0&&isUseCookies!=null)
这样写就报空指针错误了,why???
-----------------------------------------------
org.apache.jasper.JasperException: An exception occurred processing JSP page /dologin.jsp at line 35
32: request.setCharacterEncoding("utf-8");
33: //棣栧厛鍒ゆ柇鐢ㄦ埛鏄惁閫夋嫨浜嗚浣忕櫥褰曠姸鎬�
34: String[] isUseCookies = request.getParameterValues("isUseCookie");
35: if(isUseCookies.length>0&&isUseCookies!=null)
36: {
37: //鎶婄敤鎴峰悕鍜屽瘑鐮佷繚瀛樺湪Cookie瀵硅薄閲岄潰
38: String username = URLEncoder.encode(request.getParameter("username"),"utf-8");
呦呦米
相关分类