MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » 小弟我是一个新手,初写JSP+JAVABEAN的网页,出现了

小弟我是一个新手,初写JSP+JAVABEAN的网页,出现了一个很头疼的有关问题,请高手帮帮忙(3)

www.MyException.Cn  网友分享于:2013-09-12  浏览:5次

        String   name=rs_manager.getString(2);
        String   key=rs_manager.getString(3);
        String   type=rs_manager.getString(4);
        session.setAttribute( "id ",   id);
        session.setAttribute( "name ",   name);
        session.setAttribute( "key ",key);
        session.setAttribute( "type ",type);
        if(type.equals( "超级管理员 "))
        {response.sendRedirect( "B_SuperManager.jsp ");rs_manager.close();}
        else   if(type.equals( "管理员一 "))
          {response.sendRedirect( "B_ManagerTypeOne.jsp ");rs_manager.close();}
        else   {response.sendRedirect( "B_Login.jsp ");rs_manager.close();}
       
    }
    %>

3   ,程序报告如下:
HTTP   Status   500   -  

--------------------------------------------

type   Exception   report

message  

description   The   server   encountered   an   internal   error   ()   that   prevented   it   from   fulfilling   this   request.

exception  

org.apache.jasper.JasperException:   Exception   in   JSP:   /B_Switch.jsp:16

13:       String   managerpassword=request.getParameter( "managerpassword ");
14:       String   sql= "select   *   from   T_Manager   where   ManagerUID= "+managerid+ "and   Password= "+managerpassword+ " ";
15:       ResultSet   rs_manager=connDB.executeQuery(sql);
16:       if(!rs_manager.next()){
17:           rs_manager.close();%>
18:       <jsp:forward   page= "B_Fail.jsp "> </jsp:forward>
19:       <%}else{


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:506)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root   cause  

java.lang.NullPointerException
org.apache.jsp.B_005fSwitch_jsp._jspService(B_005fSwitch_jsp.java:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note   The   full   stack   trace   of   the   root   cause   is   available   in   the   Apache   Tomcat/5.5.20   logs.


--------------------------------------------

Apache   Tomcat/5.5.20

4,我不知道这是怎么一回事,是空指针问题??应该怎么改呀,我是头大了,搞了整整一天了!!!


文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有