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

📄 11-7.txt

📁 jsp常用实例讲解
💻 TXT
字号:
<%
String chatid=new String();
chatid=(String)session.getValue("chatid");
String chatroom=new String();
chatroom=(String)session.getValue("chatroom");
if(!(chatroom==null)){
%>
<%-- 用于保存用户所在聊天室总人数的application 对象变量的值减1 --%>
<%
int num;
String numtemp=new String();
String temp=new String();
temp=chatroom+"usernum";
numtemp=(String)application.getAttribute(temp);
num=Integer.parseInt(numtemp);
num=num-1;
numtemp=numtemp.valueOf(num);
application.setAttribute(temp,numtemp);
%>
<%-- 保存用户离开的系统公告信息 --%>
<%
temp=chatroom+"chatpoint";
String chatpoint=new String();
chatpoint=(String)application.getAttribute(temp);
int chatpointn;
chatpointn=Integer.parseInt(chatpoint);
chatpointn=chatpointn+1;
if(chatpointn==31){
	chatpointn=1;
}
chatpoint=chatpoint.valueOf(chatpointn);
temp=chatroom+"chatpoint";
application.setAttribute(temp,chatpoint);
temp=chatroom+"chatword"+chatpoint;
application.setAttribute(temp,chatid);
temp=chatroom+"chatcolor"+chatpoint;
application.setAttribute(temp,"blue");
temp=chatroom+"chatprivate"+chatpoint;
application.setAttribute(temp,"no");
session.invalidate();
%>
<html>
<head>
<title>聊天室</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#9999FF">
<div align="center">
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><b>您已经正常退出聊天室!</b></p>
<P><b>欢迎再来</b></p>
<p>&nbsp;</p>
<p><a href="login.html">重新登录</a></p>
</div>
</body>
</html>
<%
}else{
%>
您还没有登录!
<%
}
%>

⌨️ 快捷键说明

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