源代码(所有界面已经整合CSS)
登录界面源代码链接:点我直达
聊天室监听功能JSP部分代码 header.jsp
<%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312" pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style type="text/css">
body{
margin: 0;
padding: 0;
font-family: sans-serif;
}
.listen{
text-align:center;
width: 100%;
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
margin: 0;
padding: 0;
display: block;
background:#211B1B;
font-size: 15px;
font-weight: 599;
text-align: center;
color: white;
letter-spacing: 2px;
}
</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0">
<form action="">
<div class ="listen">欢迎<%=(String)request.getSession().getAttribute("nameSession") %>访问!当前在线人数为<%=application.getAttribute("peopleOnline")%>人</div>
</table>
</form>
</body>
</html>
聊天室左侧没啥用的框架 left.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'test.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style type="text/css">
*
{
margin: 0;
padding: 0;
}
body
{
font-size: 10px;
padding: 10px;
}
.menu
{
width: 200px;
margin: 0;
background-color: white;
border-radius: 20px;
box-shadow: 0 5px 10px 0px gray;
}
.menu h3
{
text-align: center;
height: 60px;
margin-top:30px;
padding-top: 20px;
font-family:Baskerville, "Palatino Linotype", Palatino, "Century Schoolbook L", "Times New Roman", "serif";
font-size:20px;
border-bottom: 2px solid lightgray;
}
.menu p
{
margin-top:10px;
padding-top:10px;
text-align: center;
font-family: Baskerville, "Palatino Linotype", Palatino, "Century Schoolbook L", "Times New Roman", "serif";
font-size:15px;
}
.changecolor{
background-color:gray;}
a{
text-decoration:</