<%@ 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="panduan.jsp" method="post">
名称:<input type="text" name="name">
<br>
密码:<input type="password" name="password">
<br>
<input type="submit" value="提交">
</form>
</body>
</html>
<%@ 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 name=request.getParameter("name");
String password=request.getParameter("password");
%>
<%if(name.equals("test1")&&password.equals("123456"))
{
out.print("密码正确");
}
else
{
response.sendRedirect("cuowu.jsp");
}%>
</body>
</html>
<%@ 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>
账号密码输入错误
</body>
</html>
![](https://images2015.cnblogs.com/blog/917837/201606/917837-20160625093039844-482600714.png)
![](https://images2015.cnblogs.com/blog/917837/201606/917837-20160625093128000-793819902.png)
![](https://images2015.cnblogs.com/blog/917837/201606/917837-20160625093145094-1575338137.png)