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

📄 content.jsp

📁 this is jsp project.By using this project we can chat using jsp code.
💻 JSP
字号:
<!-- Chunk -->
<%@ page import="jChatBox.Util.*,jChatBox.Chat.*,jChatBox.Chat.Filter.*,java.util.*,java.net.*" %>
<jsp:useBean id="UserProcessor" class="jChatBox.Service.UserProcessor" scope="application" />
<%
	jChatBox.Chat.ChatroomManager ChatroomManager = null;
	String chatroomName = "", buffering = null, todo = null;
	int chatroomMaxUsers = -1, chatroomTotalUsers = -1, refreshValue = 20, dMode = -1;
	Chatroom chatroom = null;
	ChatroomUser cUser = null;
	String jspDisplay = UserProcessor.execute(request,response,session,application);
	if (jspDisplay != null)
	{
		response.sendRedirect(response.encodeRedirectURL(jspDisplay));
	}
	else
	{
		ChatroomManager = jChatBox.Chat.ChatroomManager.getInstance();
		cUser = (ChatroomUser) session.getValue(XMLConfig.USERSESSIONID);
		if (cUser != null)
		{
			int cID = cUser.getParams().getChatroom();
			refreshValue = cUser.getParams().getRefresh();
			try
			{
				chatroom = ChatroomManager.getChatroom(cID);
				dMode = chatroom.getParams().getDisplayMode();
				chatroomName = chatroom.getParams().getName();
				chatroomMaxUsers = chatroom.getParams().getMaxUsers();
				chatroomTotalUsers = chatroom.getTotalUsers();
				buffering = request.getParameter("buffering");
				todo = request.getParameter("todo");
			} catch (ChatException ce)
			  {
			  	/** Chatroom not found */
				response.sendRedirect(response.encodeRedirectURL(Conf.JSPUSERLOGIN));
			  }
		}
	}
%>
<%
/**----------------------------*/
/** No action means blank page */
/**----------------------------*/
if (todo == null)
{%>
<html>
</html>
<%}
/**--------------------------------------------------------------------------------------*/
/** BUFFEREDFRAMED mode. Content of chatroom has been buffered in a JavaScript variable. */
/**--------------------------------------------------------------------------------------*/
else if ( (dMode == Conf.BUFFEREDFRAMED) && (buffering == null) )
{%>
<html>
<meta http-equiv=Refresh content="<%= refreshValue %>;URL=<%= response.encodeURL("content.jsp?todo=refresh") %>">
<head>
<title><%= chatroomName %></title>
<script language="JavaScript"><!--
	var thechat = '<%= CustomURLEncoder.encode((String)session.getValue("bufferedChat")).replace('+',' ') %>';
	function execute()
	{
		if (typeof(self.parent.dbcontent) != "undefined")
		{
			self.parent.dbcontent.document.open("text/html");
			self.parent.dbcontent.document.writeln(unescape(thechat));
			self.parent.dbcontent.document.write();
			self.parent.dbcontent.document.close();
		}
	}
//--></script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="execute()">
</body>
</html>
<%}
/**----------------------*/
/** Content of chatroom. */
/**----------------------*/
else
{%><%@ include file="chatroom.jsp" %><%}%>

⌨️ 快捷键说明

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