<%@ page language="java" contentType="text/html; charset=gb2312" %>
<html>
<head>
<title>
Login
</title>
</head>
<body>
<center>
<form name="frmLogin" action="/main.jsp" method="post">
<br>
用户名:<input name="user_id" type="text"><br>
密&nbsp;&nbsp;码:<input name="user_pwd" type="password"><br><br>&nbsp;&nbsp;&nbsp;&nbsp;
<input name="butSubmit" type="button" value="登陆" onClick="sub()">
&nbsp;&nbsp;&nbsp;&nbsp;
<input name="reset" type="reset" value="重写">
</form>
</center>
</body>
</html>
<script language="JavaScript">
  function sub() {
    if(frmLogin.user_id.value==""||frmLogin.user_pwd.value=="") {
      alert("用户名和密码不能为空")
    }else {
      frmLogin.submit()
    }
  }
</script>