jsp页面:
<%@ page language="java" import="java.util.*,model.*,entity.*" pageEncoding="utf-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
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%>">
<link rel="stylesheet" type="text/css" href="css/register.css">
<link rel="stylesheet" type="text/css" href="css/body.css">
<title>My JSP 'StuEntering.jsp' starting page</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">
-->
<jsp:include page="jsp/top.jsp"></jsp:include>
<jsp:include page="jsp/left.jsp"></jsp:include>
<jsp:include page="jsp/fotter.jsp"></jsp:include>
</head>
<body>
<div id="" class="left">
<div id="" class="main" align="left">
<p style="height:20px;"><font style="font-size:30px">所有学生信息</font></p>
<div class="ztable" >
<form action="allStudentServelt" method="post" ><input type="submit" value="查询" class="Denbtn"></form>
<table width="100%" border="1" cellspacing="0" cellpadding="1" align="center" style="text-align:center;font-weight:600;">
<tr>
<td width="100px" height="30px">学号</td>
<td width="80px" height="30px">姓名</td>
<td width="150px" height="30px">学院</td>
<td width="150px" height="30px">班级</td>
<td width="100px" height="30px">出生日期</td>
<td width="100px" height="30px">QQ号码</td>
<td width="100px" height="30px">手机号码</td>
<td width="100px" height="30px">操作</td>
</tr>
<c:forEach var="student" items="${studentlist}" >
<tr>
<td width="100px" height="30px">${student.studentID}</td>
<td width="80px" height="30px">${student.name}</td>
<td width="150px" height="30px">${student.collge}</td>
<td width="150px" height="30px">${student.stuClass}</td>
<td width="100px" height="30px">${student.briday}</td>
<td width="100px" height="30px">${student.QQ}</td>
<td width="100px" height="30px">${student.phone}</td>
<td width="100px" height="30px"><a href="StuUpdateservelt.to? id=${student.studentID}">修改</a><input name="dele" type="submit" value="删除"></td>
</tr>
</c:forEach>
</table>
</div>
</div>
</div>
</body>
</html>
StuUpdateservelt页面:
package Contorl;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import entity.student;
import model.Model;
public class stuUpdateservelt extends HttpServlet {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Constructor of the object.
*/
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* 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 {
String stuid = request.getParameter("id");
int studentid = Integer.valueOf(stuid);
System.out.println(studentid);
Model model=new Model();
student stud = model.stuinster(studentid);
System.out.println("111");
request.setAttribute("stud", stud);
System.out.println("2");
request.getRequestDispatcher("studentupdate.jsp").forward(request, response);
System.out.println("3");
}
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// TODO Auto-generated method stub
}
@Override
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
// TODO Auto-generated method stub
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// TODO Auto-generated method stub
}
}
<servlet-mapping>
<servlet-name>stuUpdateservelt</servlet-name>
<url-pattern>/StuUpdateservelt.to</url-pattern>
</servlet-mapping>
<servlet-mapping>
当点击修改为什么进不到stuUpdateservelt 这个里面啊
点击之后是这个样子:
求大佬指点下 !!!!!!!