错误代码500
org.apache.jasper.JasperException: An exception occurred processing JSP page /doLogin.jsp at line 34
31: if(isUseCookies!=null&&isUseCookies.length>0){
32: //鎶婄敤鎴峰悕鍜屽瘑鐮佷繚瀛樺埌Cookies涓�
33: //1鑾峰緱鐢ㄦ埛鍚嶅拰瀵嗙爜
34: String username = URLEncoder.encode(request.getParameter("username"),"utf-8");
35: String password = URLEncoder.encode(request.getParameter("password"),"utf-8");
36: //2鍒涘缓cookies瀵硅薄
37: Cookie usernamecookies=new Cookie("username",username);
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:575)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
root cause
java.lang.NullPointerException
java.net.URLEncoder.encode(URLEncoder.java:188)
org.apache.jsp.doLogin_jsp._jspService(doLogin_jsp.java:122)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.68 logs.
看了我的代码,和老师说的一样的,哪位大神帮我看看我是哪里错了