简单用户登录页面 - HTML、JSP 实现
Check.jsp代码:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% String username = request.getParameter("username"); String password = request.getParameter("password"); if("admin".equals(username) && "123".equals(password)) { response.sendRedirect("Success.jsp"); } else { response.sendRedirect("Error.jsp"); } %>
Success.jsp代码:
欢迎登录
Error.jsp代码:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
用户名或密码错误
该页面显示5秒后自动回到用户登录页面
AI 优化版
原文地址:https://www.cveoy.top/t/topic/oh86 著作权归作者所有。请勿转载和采集!