异常 java.lang.NullPointerException at org.apache.jsp.index_jsp._jspService(index_jsp.java:124)

 

 

这是jsp报的异常

 

jsp代码:

<%
    String LoginUsername = "";
    String LoginPassword = "";
    try {
        //获取当前站点的所有Cookie
        Cookie[] cookies = request.getCookies();
        for (int i = 0; i < cookies.length; i++) {//对cookies中的数据进行遍历,找到用户名、密码的数据
            if ("LoginUsername".equals(cookies[i].getName())) {
                LoginUsername = cookies[i].getValue();
            } else if ("LoginPassword".equals(cookies[i].getName())) {
                LoginPassword = cookies[i].getValue();
            }
        }
    } catch (Exception e) {
//        e.printStackTrace();
//        ser 调出错误输出 idea快捷键
        System.err.println("java.lang.NullPointerException:: "+"from index.jsp:69");

    }
%>

 

posted @ 2018-05-09 12:10  由良大小姐  阅读(4228)  评论(0编辑  收藏  举报