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

📄 11-5.txt

📁 jsp常用实例讲解
💻 TXT
字号:
<%-- 获取聊天室的名称和聊天刷新时间 --%>
<%
String chatroom=new String();
chatroom=(String)session.getValue("chatroom");
String retime1=new String();
retime1=(String)session.getValue("retime1");
String retime2=new String();
retime2=(String)session.getValue("retime2");
%>
<html>
<head>
<title>聊天室</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<meta http-equiv="Refresh" content"20";URL=manage.jsp">
</head>

<body bgcolor="#FFCCCC">
<form methor="GET" action="chat.jsp" target="chat">
<table width="700" border="1" cellspacing="0"  align="center">
<tr>
<td>
<p><font size="2" color="#0000FF">聊天内容:
<input type="text" name="inputword" size="40" maxlength="100">
&nbsp;&nbsp;&nbsp;&nbsp;对象:
<select name="selectuser">
	<option value="all" selected>大家</option>
<%-- 更具当前聊天室中的用户名设定此下拉菜单中的内容 --%>
<%
int num;
String numtemp=new String();
String temp=new String();
temp=chatroom+"usernum";
numtemp=(String)application.getAttribute(temp);
num=Integer.parseInt(numtemp);
for(int j=1;j<=num;j++){
	String jtemp=new String();
	jtemp=jtemp.valueOf(j);
	temp=chatroom+"user"+jtemp;
	String usertemp=new String();
	usertemp=(String)application.getAttribute(temp);
%>
	<option value="<%=usertemp%>"><%=usertemp%></option>
<%
}
%>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;颜色:
<select name="selectcolor">
	<option value="red">红 色</option>
	<option value="blue">蓝 色</option>
	<option value="green">绿 色</option>
	<option value="yellow">黄 色</option>
	<option value="black" selected>黑 色</option>
	<option value="purple">紫 色</option>
</select>
</font></p>
<p><font size="2" color="#0000FF">表情:
<select name="selectface">
	<option value="0" selected>无</option>
	<option value="1" >微笑</option>
	<option value="2">大笑</option>
	<option value="3">愤怒</option>
	<option value="4">生气</option>
	<option value="5">撒娇</option>
	<option value="6">严肃</option>
</select>
&nbsp:&nbsp;聊天刷新:
<select name="selectre1">
	<option value="<%=retime1%>" selected><%=retime1%></option>
	<option value="5">5秒</option>
	<option value="10">10秒</option>
	<option value="20">20秒</option>
	<option value="30">30秒</option>
</select>
&nbsp;&nbsp;用户刷新:
<select name="selectre2">
	<option value="<%=retime2%>" selected><%=retime2%></option>
	<option value="5">5秒</option>
	<option value="10">10秒</option>
	<option value="20">20秒</option>
	<option value="30">30秒</option>
</select>
&nbsp;&nbsp;
<input type="checkbox" name="radprivate" value="yes">
&nbsp;&nbsp;私聊
&nbsp;&nbsp;
<input type="submit" name="cmdok" value="发送">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="bye.jsp" target="_parent">离开聊天室</a>
</font>
</td>
</tr>
</table>
<input type="hidden" name="isret" value="no">
</form>
</body>
</html>

⌨️ 快捷键说明

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