JAVA AJAX教程第一章—初识AJAX
2009-10-27 00:00:00 来源:WEB开发网下面是Eclipse中的层次结果:
login.jsp代码如下:
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String result = (String)session.getAttribute("result");
if(result != null && result != ""){
if(result.equals("ok")){
out.println("<script>window.alert('热烈的欢迎你!')</script>");
}else{
out.println("<script>winodw.alert('对不起,登陆失败!')</script>");
}
session.invalidate();
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="login" method="post">
用户名:<input type="text" name="uname">
密码:<input type="password" size="20" name="pwd">
<input type="submit" value="login">
</form>
</body>
</html>
更多精彩
赞助商链接