userLogin.jsp
<form action="userReceive.jsp>" method="post">
姓 名:<input type="text" name="RdName"><br>
密 码:<input type="password" name="Rdpasswd"><br><br>
<input type="submit"value="确定">
</form>
userReceive.jsp
<body>
<%String Name=request.getParameter("RdName");
String Passwd=request.getParameter("Rdpasswd");
if(Name.equals("LL")&&Passwd.equals("123456")) %>
<jsp:forward page="loginCorrect.jsp"></jsp:forward>
<%else %>
<jsp:forward page="loginFail"></jsp:forward>
</body>
loginFail.jsp
<body>
登录失败!请重新登录。<br>
<a href="userLogin.jsp">登录页面</a>
</body>
loginCorrect.jsp
<body>
<%String Name=request.getParameter("RdName"); %>
欢迎,<%=Name %>成功登录!
</body>
时间: 2024-10-11 10:28:03