题目描述
login.jsp
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>登录</title>
<script type="text/javascript">
function LoginSubmit()
{
var id= document.loginpage.id.value;
var pwd=document.loginpage.pwd.value;
if(id==null||id=="")
{
alert("请填写用户名!");
}
else if(pwd==null||pwd=="")
{
alert("请填写密码!");
}
else
document.loginpage.submit();
}
</script>
</head>
<body>
<center>
<form action="CheckServlet" method="post" name="loginpage">
PersonalID:<input type="text" name="id">
<br>
password:<input type="password" name="pwd">
<br>
<input type="button" value="一键提交" onclick="LoginSubmit()">
</form>
</center>
</body>
</html>
CheckServlet.java
package com.servelt;
import java.io