<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>主页</title>
<style>
a{
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
font-size: 40px;
color: #000000;
text-decoration: none;
}
a:hover {
color: blue;
}
</style>
</head>
<body background="back.jpg">
<%
String username=null;
String password="";
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();
}
}
}
%>
<a href="login.jsp">当前身份:<%
if(username==null)
{
out.print("未登录");
}else
{
out.print(username);
}
%></a>
<div style="margin-top: 300px; margin-left: 700px;">
<%
if(username!=null)
{
%><a href="content.jsp?pages=1">中共中央国务院关于完整准确全面贯彻新发展理念做好 碳达峰碳中和工作的意见</a><br><br><br><br>
<a href="content.jsp?pages=2">中共中央国务院印发《国家创新驱动发展战略纲要》</a><br><br><br><br>
<a href="content.jsp?pages=3">国务院办公厅关于积极推进供应链创新与应用的指导意见</a><br><br><br><br><%
}
else
{
%>
<a href="login.jsp?pages=1">中共中央国务院关于完整准确全面贯彻新发展理念做好 碳达峰碳中和工作的意见</a><br><br><br><br>
<a href="login.jsp?pages=2">中共中央国务院印发《国家创新驱动发展战略纲要》</a><br><br><br><br>
<a href="login.jsp?pages=3">国务院办公厅关于积极推进供应链创新与应用的指导意见</a><br><br><br><br>
<div style="margin-left:600px"><a href="login.jsp?pages=0" style="text-align:center">登录</a></div>
<%
}
%>
</div>
</body>
</html>