<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>登录</title>
<style type="text/css">
table {
/*表格边框为实线或者是空心双线*/
border-collapse: collapse;
/*边框与边框的空间*/
border-spacing: 0;
padding: 40px ;
}
#loginMain {
width: 400px;
height:300px;
margin: 1em auto;
padding-bottom: 10px;
border-right: rgb(30,144,255) 2px solid;
border-top: rgb(30,144,255) 2px solid;
border-left: rgb(30,144,255) 2px solid;
border-bottom: rgb(30,144,255) 2px solid;
}
input{
height: 40px;
width: 240px;
}
</style>
</head>
<%
String pages="";
pages=request.getParameter("pages");
%>
<%
String username="";
String password="";
out.print(pages);
//获取cookie里面的值
Cookie [] cookies = request.getCookies();
if(cookies!=null){
//遍历cookie
for(int i = 0;i<cookies.length;i++){
if(cookies[i].getName().equals("username")){
//获取cookie里面的用户名
username = cookies[i].getValue();
}else if(cookies[i].getName().equals("password")){
//获取密码
password = cookies[i].getValue();
}
}
}
%>
<body background="back.jpg">
<h1 align="center">登 陆</h1>
<br><br>
<form action="check.jsp" method="post">
<table id="loginMain" border="0" style="font-size:18px;width:480px" align="center">
<tr>
<td align="center">用户名:<input type="text" name="username" size="20" placeholder="输入用户名" style="font-size:18px"/>
<br><br><input type="hidden" name="pages" value=<%=pages%> />
密 码:<input type="password" name="password" size="20" placeholder="输入密码" style="font-size:18px"/></td>
</tr>
<tr><td align="center" colspan="2"><input type="submit" value="登录" style="width:45px;height:30px;margin:5px 40px"/>
<input type="reset" value="重置" style="width:45px;height:30px;margin:5px 40px"/>
</td>
</tr>
</table>
</form>
</body>
</html>

【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术