onechat.jsp

来自「JAVA数据库编程实例随书源码」· JSP 代码 · 共 40 行

JSP
40
字号
<%@ page errorPage="ErrorPage.jsp" %>
<%@ page contentType="text/html;charset=gb2312" %>
<jsp:useBean id="thisUser" scope="session" class="chatroom.oneUser" />
<jsp:useBean id="thischatroom" scope="application" class="chatroom.ChatRoom" />
<%
int intchatroom=Integer.parseInt(thisUser.getUserPosion());
%>
<HTML>
   <HEAD>
      <meta http-equiv="Refresh" content="<%=thisUser.getRetimeChat(intchatroom)%>;URL=/mytest/jsp/onechat.jsp">
      <script language=javascript>
      var timeRun=false;
      var timeID;
      function chatScroll(){
      this.scroll(0,10000);
      if(timeRun) clearTimeout(timeID);
      timeID=setTimeout('chatScroll()',100);
      timeRun=true;
      }function scrollStop(){
      if(timeRun) {clearTimeout(timeID); timeRun=false;}
      else chatScroll();
      }
      function rop(){
      setTimeout('rop()',10000);
      }
      chatScroll();
      rop();
      </script>
   </HEAD>
   <BODY>
<%
  if (thisUser.getUserName() != null)
    {String UserId=thisUser.getUserId();
     String allSpeaking=thischatroom.returnAllSpeaking(intchatroom,UserId);
     out.print(allSpeaking);
    }
    else out.print("尚未登录,进入<a href='/mytest/jsp/login.jsp'>用户登录</a>");
%>
   </BODY>
</HTML>

⌨️ 快捷键说明

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