如何使第一次登陆页面时不检查request里面的值
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ page import="java.sql.*" %>
<%
request.setCharacterEncoding("gbk");
String telnum = request.getParameter("numcheck");
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
Class.forName("com.mysql.jdbc.Driver");
String url= "jdbc:mysql://localhost:3306/clientmanage?user=root&password=absolute";
conn = DriverManager.getConnection(url);
stmt = conn.createStatement();
rs = stmt.executeQuery("select * from clientlist where telnum = " + telnum);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<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">
<style type="text/css">
th {background-color:#99CCFF}
</style>
<script language="javascript">
/****Check whether the number is empty****/
function check() {
if(document.checkclient.numcheck.value == "") {
alert("请输入号码");
return false;
}
else {
return true;
}
}
</script>
</head>
<body>
<form name="checkclient" action="checkok.jsp" method="post" onSubmit="return check()">
<div align="center">
手机号码:
<input type="text" name="numcheck">
<input type="submit" name="submit" value="查询">
</div>
</form>
<br><br>
<table width="700"align="center" border="5" bordercolor="#99CCFF" cellspacing="3" cellpadding="5">
<caption><h1 >用户信息</h1></caption>
<th>用户姓名</th>
<th>用户车牌</th>
<th>用户号码</th>
<th>服务地点</th>
<th>备注</th>
<th>性别</th>
<th>时间</th>
<th>次数</th>
<!-- Check whether there is a number -->
<% if(!rs.next()) { %>
<script type="text/javascript">
alert("无此号码,请重新输入");
</script>
<% } else { %>
<% while(rs.next()) { %>
<tr>
<td><%= rs.getString("name") %></td>
<td><%= rs.getString("carnum") %></td>
<td><%= rs.getString("telnum") %></td>
<td><%= rs.getString("location") %></td>
<td><%= rs.getString("remark") %></td>
<td><%= rs.getString("sex") %></td>
<td><%= rs.getDate("date") %></td>
<td><%= rs.getString("count") %></td>
</tr>
<% }} %>
</table><br><br>
<div align="center">
<a href="main.jsp" target="_parent">返回首页</a>
</div>
<%
rs.close();
stmt.close();
conn.close();
%>
</body>
</html>
(request.getParameter("numcheck"));
去掉空格看看,你先判断下,不输入是。telnum值是什么,排除掉,就行了