<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">
function check()
{
var uname = document.getElementById("uname").value;
var pwd = document.getElementById("pwd").value;
if(uname==null ||uname=='')
{
alert('用户名不能为空')
return false
}
if(pwd==null || pwd=='')
{
alert('密码不能为空')
return false
}
return true
}
</script>
</head>
<body>
<form action="${pageContext.request.contextPath}/login" method="post" οnsubmit="return check()">
<p>
用户名:<input type="text" name="uname" id="uname">
</p>
<p>
密码:<input type="password" name="pwd" id="pwd">
</p>
<p>
<input type="submit" value="登录">
</p>
</form>
</body>
</html>