1,使用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>登录页面</title>
</head>
<body>
<form action="zuoye1-1.jsp"method="post"name="form">
<div align="center">
<h3>管理员登录</h3>
登录名:<input type="text"name="a"><br>
密 码:<input type="text"name="b"><br>
<input type="submit" name=submit value="登录">
</div>
</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>管理员登录验证</title>
</head>
<body>
<%
String name=request.getParameter("a");
String pass=request.getParameter("b");
if("admin".equals(name)&&"123".equals(pass)){
request.getRequestDispatcher("zuoye1-2.jsp").forward(request, res