求助!!ecplise中出现 Description The origin server did not find a current representati
刚开始学习有关java web的内容,在联系连接MySQL数据库,然后实现简单的登录页面,但是页面跳转不了,请问这是什么原因,哪个大神能来指点一下!!!===============================================================================================================
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="DengLuServlet" method="post">
<input type="text" name="sname" /><br/>
<input type="password" name="spwd" "/><br/>
<input type="submit" value="登录"/>
</form>
</html>
==========================================================================================================
DengLuServlet.java
package servlet;
import
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dao.StudentDao;
import users.Student;
/**
* Servlet implementation class RegServlet
*/
public class DengLuServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public DengLuServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
request.setCharacterEncoding("utf-8");
String username=request.getParameter("sname");
String pwd=request.getParameter("spwd");
Student st = new Student();
StudentDao dao=new StudentDao();
try {
st=dao.getStudentOne(username,pwd);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(st == null)
response.sendRedirect("fail.jsp");
else
response.sendRedirect("exam.jsp");
}
}
========================================================================
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www. xmlns="http://xmlns. xsi:schemaLocation="http://xmlns. http://xmlns. id="WebApp_ID" version="3.1">
<display-name>denglu</display-name>
<servlet>
<servlet-name>DengluServlet</servlet-name>
<servlet-class>DengluServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>DengluServlet</servlet-name>
<url-pattern>/DengluServlet</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>servlet.LoginServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
</web-app>