日期:2014-05-18  浏览次数:20763 次

请问大家这个什么错误啊!!!
<%@   page   contentType= "text/html;   charset=GBK "   %>
<html>
<head>
<title>
df
</title>
</head>
<body   bgcolor= "#ffffff ">
<form   action= "df.jsp "   method= "post "   name= "form ">
用户名 <input   type= "text "   name= "name "> <br   />
密码 <input   type= "password "   name= "password "> <br   />
<center   >
<input     type= "submit "   name= "submit "   value= "验证 "/> </center>
</form>
<%String   name=request.getParameter( "name ");
    String   password=request.getParameter( "password ");
    if(password.equals( "go ")){
                    session.setAttribute( "name ", "ok ");
                    session.setAttribute( "mess ", "你好,你已经验证成功 ");

    }else{session.setAttribute( "name ", "no ");
    session.setAttribute( "mess ", "qing   chong     denglu   ");

}
response.sendRedirect( "2.jsp ");%>


</body>
</html>


rg.apache.jasper.JasperException
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root   cause   java.lang.NullPointerException
  org.apache.jsp.df_jsp._jspService(df_jsp.java:58)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note   The   full   stack   trace   of   the   root   ca



------解决方案--------------------
up
------解决方案--------------------
NullPointerException 空指針異常

調試一下你的name和password有沒有值
------解决方案--------------------
<%@ page contentType= "text/html; charset=GBK " %>
<html>
<head>
<title>
df
</title>
</head>
<body bgcolor= "#ffffff ">
<form action= "df.jsp " method= "post " name= "form ">
用户名 <input type= "text " name= "name "> <br />
密码 <input type= "password " name= "password "> <br />
<center >
<input