⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.jsp

📁 对于JAVA开发者来说
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=gbk"
    pageEncoding="gbk"%>

<%
String action =request.getParameter("action");

if (action != null && action.equals("Login")){
	String username = request.getParameter("uname");
	String password = request.getParameter("pwd");
	if (username.equals("admin") && password.equals("admin")){
		out.println("欢迎管理员" + request.getParameter("uname") + "登录");
		session.setAttribute("admin", "true");
		response.sendRedirect("ShowArticleTree.jsp");
		//return;
	}else{
		out.println("用户名或密码错误");
	//return;
	}
}
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<title>管理员登录</title>
</head>
<body>
<div align="center"><font color="red" size=5><b>管理员登录</b></font><br>
<form action="Login.jsp" method="post">
<table align="center" broder=0>
<input type="hidden" name="action" value="Login">
<tr><td><font color="red" size=5><b>用户名:</b></font></td><td>
<input type="text" name="uname" size=20></td></tr>
<tr><td><font color="red" size=5><b>密&nbsp码:</b></font></td><td>
<input type="password" name="pwd" size=20></td></tr>
</table>
<input type="submit" value="提交">
<input type="reset" value="重置">
<br><br>
<a href="New.jsp"><font color="blue" size=4><b>新用户注册</b></font></a>
</form>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -