<%@ page language="java" import="java.util.*" pageEncoding="utf-8"
contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<br>
function check(form){<br>
with(form){<br>
if(username.value == ""){<br>
alert("用户名不能为空!");<br>
return false;<br>
}<br>
if(password.value == ""){<br>
alert("密码不能为空");<br>
return false;<br>
}</p>
<pre><code> return true;
}
}
</code></pre>
<p>
学生籍贯管理系统
<div class="container">
<div align="center">
<form class="well" name="login" action="user/checkLogin.action" method="post" onsubmit="return check(this)">
<label>用户名</label> <input type="text" name="username" class="span3" placeholder="用户名"> <p/>
<label>密 码</label> <input type="password" name="password" class="span3" placeholder="密码"><p/>
<button type="submit" id="btn_login" class="btn btn-success">登陆</button> <button type="button" class="btn btn-primary" onclick="window.location.href='register.jsp'">注册</button>
</form>
</div>
onsubmit="return check(this)里的this咋理解?