请问为什么我从表单输入数据库有的信息后转入到cometruejdbs_1.jsp后不能输出该信息的内容
下面是我的jdbc_1.jsp文件<%@ 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="cometruejdbc_1.jsp" method="post">
姓名<input type="text" name="Cname">
<input type="submit" value="提交">
<input type="reset" value="重置">
</form>
</body>
</html>
下面是我的cometruejdbc_1.jsp文件
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" import="java.sql.*" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body>
<center>顾客信息表</center>
<%
out.println("<table border= 1 align = center width= 700>");
out.println("<tr>");
out.println("<td align = center> 姓名 </td>");
out.println("<td align = center> 电话号码 </td>");
out.println("<td align = center> 住址 </td>");
out.println("<td align = center> 已购器材 </td>");
out.println("<td align = center> 应付金额 </td>");
out.println("</tr>");
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/commerce","root","xxx");
PreparedStatement stmt = con.prepareStatement("select * from customer where Cname like ?");
String name = request.getParameter("Cname");
stmt.setString(1,name);
ResultSet rs = stmt.executeQuery();
while(rs.next())
{
out.println("<tr>");
out.println("<td>"+rs.getString(1)+"</td>");
out.println("<td>"+rs.getString(2)+"</td>");
out.println("<td>"+rs.getString(3)+"</td>");
out.println("<td>"+rs.getString(4)+"</td>");
out.println("<td>"+rs.getString(5)+"</td>");
out.println("</tr>");
}
out.println("</table>");
rs.close();
stmt.close();
con.close();
%>
</body>
</html>