sender_do.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:2k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"
  2. import = "java.io.*"
  3. import = "cn.js.fan.util.*"
  4. import = "com.redmoon.chat.*"
  5. %>
  6. <%
  7. String mode = ParamUtil.get( request, "mode" );
  8. ChatClient cc = new ChatClient();
  9. String room = ParamUtil.get( request, "room" );
  10. String user = ParamUtil.get( request, "user" );
  11. %>
  12. <script>
  13. function showmsg(msg) {
  14.     if (typeof(window.parent.chatappletarea.showmsg)=="function")
  15. window.parent.chatappletarea.showmsg(msg);
  16. }
  17. </script>
  18. <%
  19. if ( mode.equals("send") ) {
  20. String message = ParamUtil.get( request, "message" );
  21. out.print(message);
  22. String ret = cc.send(user, room, message);
  23. %>
  24. <script>
  25. <%=ret%>
  26. </script>
  27. <%}%>
  28. <%
  29. if ( mode.equals("jumptoroom") ) {
  30. String newroom = ParamUtil.get( request, "newroom" );
  31. String ret = cc.jumptoroom(user, room, newroom);
  32. %>
  33. <script>
  34. <%=ret%>
  35. window.parent.chatappletarea.location.href = "chatapplet.jsp?nick=<%=StrUtil.UrlEncode(user)%>&room=<%=StrUtil.UrlEncode(newroom)%>&reloadreason=jumptoroom";
  36. </script>
  37. <%}%>
  38. <%
  39. if ( mode.equals("rename") ) {
  40. String newuser = ParamUtil.get( request, "newuser" );
  41. String ret = cc.ReName(user, room, newuser);
  42. if ( ret==newuser ) {
  43. %>
  44. <script>
  45. window.parent.chatappletarea.location.href = "chatapplet.jsp?nick=<%=StrUtil.UrlEncode(newuser)%>&room=<%=StrUtil.UrlEncode(room)%>";
  46. </script>
  47. <%
  48. }
  49. else {
  50. %>
  51. <script>
  52. <%=ret%>
  53. </script>
  54. <%
  55. }
  56. }%>
  57. <%
  58. if ( mode.equals("roominfo") ) {
  59. String ret = cc.getRoomInfo(user, room);
  60. %>
  61. <script>
  62. <%=ret%>
  63. </script>
  64. <%}%>
  65. <%
  66. if ( mode.equals("getuserinfo") ) {
  67. String whichuser = ParamUtil.get(request, "nick");
  68. String ret = cc.getUserInfo(user, room, whichuser);
  69. %>
  70. <script>
  71. <%=ret%>
  72. </script>
  73. <%}%>
  74. <%
  75. if ( mode.equals("sendAnnounce") ) {
  76. String announce = ParamUtil.get(request, "announce");
  77. String ret = cc.sendAnnounce(user, room, announce);
  78. %>
  79. <script>
  80. <%=ret%>
  81. </script>
  82. <%}%>
  83. <%
  84. if ( mode.equals("kicksb") ) {
  85. String sb = ParamUtil.get(request, "sb");
  86. String ret = cc.kicksb(user, room, sb);
  87. %>
  88. <script>
  89. <%=ret%>
  90. </script>
  91. <%}%>