<html>
<head>
<title>First Web App</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<form action="LoginServlet" method="post">
<div><h2>My First Webapp</h2></div>
<p></p>
<div><h3>User Name:<input type="text" name="username" id="username"></h3></div>
<p></p>
<div><h3>Password:<input type="password" name="password" id="password"></h3></div>
<p></p>
<input type="submit" value="login" id="loginsubmit"/>
</form>
</body>
答案 0 :(得分:0)
ResultSet
表格索引从1
开始而非0
,因此请更改您的for loops
这样的
for(int i=1;i<=cnt;++i)
{
....
}