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

📄 searchok_jsp.java

📁 网吧网站留言本。主要使用基于MVC模式的JSP+JAVABEAN+SERVLET
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
    com.netbar.bean.gbBean gbbean = (com.netbar.bean.gbBean)vcs.get(i);
    int id = gbbean.getGbID();
    String title = gbbean.getGbTitle();
    String content = gbbean.getGbContent();
    String reply = gbbean.getGbReply();
    String person = gbbean.getGbPerson();
    String web = gbbean.getGbWeb();
    String mail = gbbean.getGbMail();
    String qq = gbbean.getGbQQ();
    String face = gbbean.getGbFace();
    String ip = gbbean.getGbIP();
    String pcname = gbbean.getGbPcname();
    String time = gbbean.getGbTime();
    String redate = gbbean.getGbRedate();
    //将查询的关键字返红显示
    if(session.getAttribute("keyword")!=null){
      String classNames=(String)session.getAttribute("className");
      if(classNames.equals("gbTitle")){
        title=title.replaceAll(keyword,"<font color='red'>"+keyword+"</font>");
      }

       if(classNames.equals("gbPerson")){
         person=person.replaceAll(keyword,"<font color='red'>"+keyword+"</font>");
      }

       if(classNames.equals("gbContent")){
         content=content.replaceAll(keyword,"<font color='red'>"+keyword+"</font>");
      }

      if(classNames.equals("gbReply")){
         reply=reply.replaceAll(keyword,"<font color='red'>"+keyword+"</font>");
      }


    }
    //System.out.println(!reply.equals("暂无回复") + "\n\n\n\n\n");

      out.write("\r\n<table width=\"680\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#EBF2F8\" class=\"biao_bdr\" style=\"table-layout:fixed;word-break:break-all\">\r\n  <tr>\r\n    <td width=\"140\" rowspan=\"2\" style=\"border-right: 1px solid #d1e0f0;\">\r\n      <table width=\"98%\" height=\"35\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n        <tr>\r\n          <td>\r\n            <div align=\"center\">\r\n              <font style=\"FONT-SIZE: 10pt; FILTER: shadow(color=#C0C0C0); COLOR: #000000; HEIGHT: 1px\">");
      out.print(person);
      out.write("              </font>\r\n            </div>\r\n          </td>\r\n        </tr>\r\n      </table>\r\n      <div align=\"center\">\r\n        ");

       if(!face.equals("images/admin.gif")){

       
      out.write("\r\n       <img width=\"64\" height=\"64\" src=\"");
      out.print(face);
      out.write("\" alt=\"【");
      out.print(person);
      out.write("】的ID为:");
      out.print(id);
      out.write("\">\r\n        ");
}else{
        
      out.write("\r\n        <img width=\"128\" height=\"128\" src=\"");
      out.print(face);
      out.write("\" alt=\"【");
      out.print(person);
      out.write("】的ID为:");
      out.print(id);
      out.write("\">\r\n       ");
 }
      out.write("\r\n        <br>\r\n      </div>\r\n      <div align=\"center\">\r\n        <table width=\"125\" height=\"28\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n          <tr>\r\n            <td>\r\n              <div align=\"center\">\r\n              ");
if (qq.trim().length() != 0 && qq != null) {              
      out.write("\r\n                <img src=\"images/oicq.gif\" alt=\"QQ:");
      out.print(qq);
      out.write("\" width=\"16\" height=\"16\">\r\n              ");
}              
      out.write("\r\n              ");
if (session.getAttribute("logined") != null) {              
      out.write("\r\n                <img src=\"images/icon_ip.gif\" alt=\"计算机名:");
      out.print(pcname);
      out.write("\" width=\"13\" height=\"15\">\r\n              ");
} else {              
      out.write("\r\n                <img src=\"images/icon_ip.gif\" alt=\"IP:");
      out.print(ip);
      out.write("\" width=\"13\" height=\"15\">\r\n              ");
}              
      out.write("\r\n              ");
if ((!mail.equals("")) && mail != null) {              
      out.write("\r\n                <a href=\"mailto:");
      out.print(mail);
      out.write("\">\r\n                  <img src=\"images/email.gif\" alt=\"邮箱:");
      out.print(mail);
      out.write("\" width=\"16\" height=\"16\" border=\"0\">\r\n                </a>\r\n              ");
}              
      out.write("\r\n              ");
if (!web.equals("") && (!web.equals("http://")) && web != null) {              
      out.write("\r\n                <a href=\"");
      out.print(web);
      out.write("\" target=\"_blank\">\r\n                  <img src=\"images/homepage.gif\" alt=\"个人主页:");
      out.print(web);
      out.write("\" width=\"16\" height=\"16\" border=\"0\">\r\n                ");
}                
      out.write("\r\n                  <br>\r\n                </a>\r\n              </div>\r\n            </td>\r\n          </tr>\r\n        </table>\r\n      </div>\r\n      <div align=\"center\">\r\n        <table width=\"96\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"table-layout:fixed;word-break:break-all\">\r\n          <tr>\r\n            <td style=\"padding:4px;word-wrap: break-word\">            </td>\r\n          </tr>\r\n        </table>\r\n      </div>\r\n    </td>\r\n    <td>\r\n      <table width=\"99%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n        <tr>\r\n          <td>            &nbsp;\r\n            <strong>\r\n              <img src=\"images/more01.gif\" width=\"15\" height=\"14\" border=\"0\" align=\"middle\">\r\n");
      out.print(title );
      out.write("            </strong>\r\n            <table width=\"520\" height=\"1\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#d1e0f0\">\r\n              <tr>\r\n                <td>                </td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n        </tr>\r\n      </table>\r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td>\r\n      <table width=\"540\" height=\"120\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n        <tr>\r\n          <td height=\"40\">\r\n            <table width=\"520\" height=\"50\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"table-layout:fixed;word-break:break-all\">\r\n              <tbody>\r\n                <tr>\r\n                  <td style=\"padding:4px;word-wrap: break-word\">                    &nbsp;\r\n                    <font style=\"FONT-SIZE: 10pt; FILTER: shadow(color=#C0C0C0); COLOR: #000000; HEIGHT: 1px\">");
      out.print(content);
      out.write("                    </font>\r\n                  </td>\r\n                </tr>\r\n              </tbody>\r\n            </table>\r\n          </td>\r\n        </tr>\r\n        <tr>\r\n          <td>\r\n            <div align=\"right\">\r\n            ");
if (session.getAttribute("logined") != null) {            
      out.write("\r\n              <a href=\"res.jsp?id=");
      out.print(id);
      out.write("\" target=\"_self\" style=\"color:red\">回复</a>\r\n              |\r\n              <a href=\"del.jsp?id=");
      out.print(id);
      out.write("\" style=\"color:red\">删除</a>\r\n              &nbsp;\r\n            ");
}            
      out.write("\r\n              [\r\n              <strong>");
      out.print(time);
      out.write("              </strong>\r\n              ]\r\n              &nbsp;\r\n            </div>\r\n          </td>\r\n        </tr>\r\n        <tr>\r\n          <td>\r\n            <p style=\"color: #0033CC\">\r\n              <font style=\"FONT-SIZE: 10pt; FILTER: shadow(color=#c0c0c0); COLOR: blue; HEIGHT: 1px\">\r\n              ");
if (reply!=null && !reply.equals("暂无回复")) {           
      out.write("\r\n                &nbsp;\r\n                <img src=\"images/bb01.gif\" width=\"21\" height=\"14\" border=\"0\" align=\"absmiddle\">\r\n                中青回复:\r\n");
      out.print(reply);
      out.write("              </font>\r\n            </p>\r\n            <p style=\"color: #0033CC\">&nbsp;</p>\r\n            <p align=\"right\" style=\"color: #0033CC\">\r\n              <font style=\"FONT-SIZE: 10pt; FILTER: shadow(color=#c0c0c0); COLOR: blue; HEIGHT: 1px\">                回复日期:【\r\n");
      out.print(redate);
      out.write("                】\r\n                &nbsp;\r\n                <br>\r\n              ");
}              
      out.write("\r\n              </font>\r\n            </p>\r\n            <p style=\"color: #0033CC\">&nbsp;</p>\r\n            <div align=\"right\">            </div>\r\n          </td>\r\n        </tr>\r\n      </table>\r\n    </td>\r\n  </tr>\r\n</table>\r\n");
}
      out.write("\r\n<table width=\"680\" height=\"12\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#66CCFF\" class=\"biao_bdr2\">\r\n  <tr>\r\n    <td>\r\n      <div align=\"center\">\r\n    总计\r\n");
      out.print(totalRecords);
      out.write("        条\r\n        &nbsp;\r\n        共有\r\n");
      out.print(currentPage);
      out.write("        /\r\n");
      out.print(pageSize);
      out.write("        页\r\n        &nbsp;\r\n        每页\r\n");
      out.print( recordRows );
      out.write("        条\r\n        &nbsp;\r\n      ");
if (currentPage != 1) {      
      out.write("\r\n        <a href=\"searchok.jsp\">首页</a>\r\n        <a href=\"searchok.jsp?currentPage=");
      out.print(currentPage-1);
      out.write("\">上一页</a>\r\n        &nbsp;\r\n      ");
}      
      out.write("\r\n      ");
if (currentPage != pageSize) {      
      out.write("\r\n        <a href=\"searchok.jsp?currentPage=");
      out.print(currentPage+1);
      out.write("\">下一页</a>\r\n        &nbsp;\r\n        <a href=\"searchok.jsp?currentPage=");
      out.print(pageSize);
      out.write("\">尾页</a>\r\n      ");
}      
      out.write("\r\n\r\n      </div>\r\n    </td>\r\n  </tr>\r\n</table>\r\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "buttom.jsp", out, true);
      out.write("\r\n</body>\r\n</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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