登陆页面(login.jsp)
<%@ 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">
<title>Insert title here</title>
</head>
<body>
<form action="login2.jsp" method="post" >
<h1 align="center">用户登陆界面</h1>
<p align="center">用户名:<input type="text" name="name"></p>
<p align="center">密码:<input type="password" name="pass"></p><br/>
<p align="center"><input type="submit" value="提交" name="ok">
<input type="reset" value="重置"></p>
</form>
</body>
</html>
login2.jsp(判断页面)
<%@ 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">
<title>Insert title here</title>
</head>
<body>
<%
String username=request.getParameter("name");
String pass=request.getParameter("pass");
if(username.equals("蒋欢")&&pass.equals("131455"))
{
out.print("登陆成功!");
}
else
out.print("登陆失败!");
%>
</body>
</html>