我有一个登录的页面,代码为
<body >
  <center>
  <form name="login" action="/CheckLoginServlet" method="post">
  <table width="80%" border="1">
  <tr>
     <td align="center" colspan="2"><img src="images/regsucc.PNG" width="216" height="44" /></td>
  </tr>
  <tr>
   <td width="50%"><div align="right">用户名:</div></td>
    <td width="50%"><input type="text" name="username" /></td>
  </tr>
  <tr>
     <td><div align="right">密码:</div></td>
    <td><input type="password" name="password" /></td>
  </tr>
  <tr>
    <td align="right"><input type="submit" name="login" value="登录"/> </td>
    <td ><div align="left"><a href="register.jsp"><img src="images/rereg.PNG" width="90" height="32" border="0"/></a></div></td>
  </tr>
</table></form>
 </center> </body>
</html>CheckLoginServlet的代码为:
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { /**response.setContentType("text/html");
PrintWriter out = response.getWriter();
out
.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<HTML>");
out.println("  <HEAD><TITLE>A Servlet</TITLE></HEAD>");
out.println("  <BODY>");
out.print("    This is ");
out.print(this.getClass());
out.println(", using the GET method");
out.println("  </BODY>");
out.println("</HTML>");
out.flush();
out.close();*/
 String username=request.getParameter("username");
    String password=request.getParameter("password");
    HttpSession session=request.getSession();
    session.setAttribute("user", username);
    CheckUser user=new CheckUser();
    boolean i=user.check(username, password);
 if (i==true){
     request.getRequestDispatcher("index.jsp").forward(request, response);
    }else{
     response.sendRedirect("loginError.jsp");
    }  


}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { this.doPost(request, response);
}}
我点击登陆之后,却出现