異常 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");

    }
%>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM