JSP页面:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>登陆</title>
    
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

<style type="text/css">
<!--
#a{
margin: auto auto;
text-align: center;
}
-->
</style>  </head>
  
  <body>
  <form method="post" action="/shixun/Lfind">
    <div id="a">
    用户名:<input type="text" name="name" size="20" maxlength="18"><br/>
    密&nbsp;&nbsp;&nbsp;码:<input type="password" name="password" size="20" maxlength="18"><br/>
    <div id="a">
    <input name="submit" type="submit" class="buttom" value="提交">
    <input name="reset" type="reset" class="buttom" value="重置">
    <a href="login/zhuce.jsp"><input type="button" value="注册"></a>
    </div>
    </div>
    </form>
  </body>
</html>servlet页面:
package loginservlet;import java.io.IOException;
import java.util.List;
import java.io.PrintWriter;import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import Dao.dengluDao;
import Bean.login;public class Lfind extends HttpServlet { /**
 * Constructor of the object.
 */
public Lfind() {
super();
} /**
 * Destruction of the servlet. <br>
 */
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
} /**
 * The doGet method of the servlet. <br>
 *
 * This method is called when a form has its tag value method equals to get.
 * 
 * @param request the request send by the client to the server
 * @param response the response send by the server to the client
 * @throws ServletException if an error occurred
 * @throws IOException if an error occurred
 */
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
} /**
 * The doPost method of the servlet. <br>
 *
 * This method is called when a form has its tag value method equals to post.
 * 
 * @param request the request send by the client to the server
 * @param response the response send by the server to the client
 * @throws ServletException if an error occurred
 * @throws IOException if an error occurred
 */
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { response.setContentType("text/html");
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
PrintWriter out = response.getWriter();
String name=request.getParameter("name");
String password = request.getParameter("password");
response.sendRedirect("index.jsp");
if(name != null && password != null){
dengluDao goodsDao=new dengluDao();
List<login> list=goodsDao.findAll("select * from users where name='"+name+"'");
if(list.equals(name) && list.equals(password)){
response.sendRedirect("index.jsp");
return;
}
}



out.flush();
out.close();
} /**
 * Initialization of the servlet. <br>
 *
 * @throws ServletException if an error occurs
 */
public void init() throws ServletException {
// Put your code here
}}XML:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/java2ee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
  <jsp-config>
    <jsp-property-group>
      <description>html encoding</description>
  <servlet>
    <description>This is the description of my J2EE component</description>
    <display-name>This is the display name of my J2EE component</display-name>
    <servlet-name>Linsert</servlet-name>
    <servlet-class>loginservlet.Linsert</servlet-class>
  </servlet>
  <servlet>
    <description>This is the description of my J2EE component</description>
    <display-name>This is the display name of my J2EE component</display-name>
    <servlet-name>Lfind</servlet-name>
    <servlet-class>loginservlet.Lfind</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>Linsert</servlet-name>
    <url-pattern>/servlet/Linsert</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>Lfind</servlet-name>
    <url-pattern>/servlet/Lfind</url-pattern>
  </servlet-mapping>
      <display-name>JSPConfiguration</display-name>
      <url-pattern>*.html</url-pattern>
      <el-ignored>true</el-ignored>
      <page-encoding>UTF-8</page-encoding>
      <scripting-invalid>false</scripting-invalid>
      <include-prelude></include-prelude>
      <include-coda></include-coda>
    </jsp-property-group>
  </jsp-config>
  <display-name></display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>
登陆界面正常进入,但是无论输入什么都会显示错误400,无法显示此页面,管理界面没有进行编写打开后仅显示一句hallo,其他servlet未与这几个页面有联系便不再复制。