<%@ 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=UTF-8">
<script type="text/javascript"
src="jquery-1.7.2.min.js"></script>
<title>Insert title
here</title>
</head>
<body
onload="login()"><!--
<iframe width="100%"
height="500px" scrolling="auto"
src="testServlet.do"></iframe>
-->
<form id="f1"
action="http://127.0.0.1:8081/test/userAction!sysLogin.action"
method="post" onsubmit="login()">
<fieldset>
<legend>Login</legend>
<label
for="username">username:</label>
<input
type="text" id="username" name="username"
value="111">
<label
for="password">password:</label>
<input
type="password" id="password" name="password"
value="111">
<input
type="submit" value="subject">
</fieldset>
</form>
</body>
<script>
function login() {
var username =
document.getElementByIdx_x("username").value;
var password =
document.getElementByIdx_x("password").value;
xhr = new
XMLHttpRequest();
xhr.open("POST",
"http://127.0.0.1:8081/test/userAction!sysLogin.action", false,
username, password);
xhr.send(null);
return xhr.status ==
200;
}
$(function(){
$("#f1").submit();
});
</script>
</html>