Login




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代码:

Success

欢迎登录

Error.jsp代码:

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

Error

用户名或密码错误

该页面显示5秒后自动回到用户登录页面


原文地址: http://www.cveoy.top/t/topic/fuEn 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录