提交表单 出现HTTP Status 404 错误 急
提交表单 出现HTTP Status 404 - /phone/servlet/DoLogin 错误
只是简单的两个jsp页面,初学,不知道为什么不能转到第二个页面,数据库都是正确的。
谢谢。
login.jsp:
<%@ page language="java" contentType="text/html; charset=GBK" import="java.sql.*" errorpage=""%>
<html>
<head>
<title>Welcome!</title>
</head>
<body bgColor=#ffffff>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width="75%">
<tr>
<TD height=300 vAlign=center width=300 ><BR>
<IMG height=299 src="./image/back.gif" width=300></TD>
<TD>
<table>
<FORM name="from1" id="from1" action="loginOn.jsp" method="post">
<tr>
<TD align="right">帐户:</TD><td></td>
<TD><input type="text" name="uesr"size="19"></TD>
</tr>
<tr>
<TD align="right">口令:</TD><td></td>
<TD><input type="password" name="userPwd" size="20"></TD>
</tr>
<tr> </tr>
<tr>
<TD><input type="submit" name="submitButton" value="提交" size="20"></TD>
<td></td>
<TD><input type="reset" name="resetButton" value="取消" size="20"></TD>
</tr>
</from>
</table>
</TD>
</tr>
</TABLE>
</body>
</html>
loginOn.jsp:
<script language="javascript">
function backward()
{
history.back();
}
</script><%@ page language="java" contentType="text/html; charset=GBK" import="java.sql.*" errorPage="error.jsp"%>
<html>
<head>
<title></title>
</head>
<body>
<p>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(ClassNotFoundException e){System.out.println(""+e);}
try{
String driver="jdbc:odbc:phone";
Connection conn=DriverManager.getConnection(driver);
Statement stmt=conn.createStatement();
boolean a;
String uid=request.getParameter("user");
String pwd=request.getParameter("userPwd");
String sql="select * from 电话卡表 where 电话卡号码='"+uid+"' and 用户密码='"+pwd+"'";
ResultSet rs=stmt.executeQuery(sql);
a=rs.next();
System.out.println("3232e4wqewe");
if(a==true) //用户输入正确
{
System.out.print(rs.getString(1));
rs.close();
session.setAttribute("uid",uid);
%>
欢迎您!<%=uid%></p>
<%}
else
{ %>
<p> </p>
<p>对不起您的输入有误,请重新填写!</p>
<P><input type="button" name="buttonBack" value="返回上一步"onclick="backward"></P>
<%}%>
<%}catch(SQLException ee){} %>
</p>
</body>
</html>