1.登录页面
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<form action="receive.jsp" method="post">
姓名:<input type="text" name="username"><br>
密码:<input type="password" name="password"><br><br>
<input type="submit" value="确 定">
</form>
</html>
2.判断页面
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<body>
<%String str1=request.getParameter("username");
String str2=request.getParameter("password");
if(str1.equals("zhangsan")&&str2.equals("123456")){%>
<jsp:forward page="loginsuc.jsp"/>
<%}else %>
<jsp:forward page="loginfai.jsp"/>
</body>
3.登陆成功页面
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<body>
<%String str1=request.getParameter("username");
String str2=request.getParameter("password");
%>
欢迎你, 成功登陆!!<br><br>
你输入的信息为:<br>
姓名: <%=str1 %><br>
密码:<%=str2 %>
</body>
</html>
4.登陆失败页面
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<body>
登陆失败!!<br><br>
<a href="http://localhost:8080/ww2/login.jsp">请重新登录!
</body>
</html>