📄 index_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "top.htm", out, true);
out.write("\r\n");
out.write("\r\n");
com.netbar.dao.gbDao gbdao = null;
synchronized (_jspx_page_context) {
gbdao = (com.netbar.dao.gbDao) _jspx_page_context.getAttribute("gbdao", PageContext.PAGE_SCOPE);
if (gbdao == null){
gbdao = new com.netbar.dao.gbDao();
_jspx_page_context.setAttribute("gbdao", gbdao, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
com.netbar.dao.gbCountDao gbcd = null;
synchronized (_jspx_page_context) {
gbcd = (com.netbar.dao.gbCountDao) _jspx_page_context.getAttribute("gbcd", PageContext.PAGE_SCOPE);
if (gbcd == null){
gbcd = new com.netbar.dao.gbCountDao();
_jspx_page_context.setAttribute("gbcd", gbcd, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
//session.setAttribute("logined","OK");
out.write('\r');
out.write('\n');
//每登陆一次计数器累加一
gbcd.updateCountWhenEnter();
out.write('\r');
out.write('\n');
//更新管理员最后登陆时间(if实现,只是登陆第一次进入页面时实现更新)。。。
if(session.getAttribute("logined")!=null && session.getAttribute("timeUpdated")==null){
gbcd.updateTimeWhenLogin();
session.setAttribute("timeUpdated","true");
}
out.write('\r');
out.write('\n');
//添加分页
int currentPage = 1; //当前页,初始为1
int recordRows = 10; //每页记录行数
int pageSize = 0; //总页数
int totalRecords = com.netbar.dao.gbDao.getgbRecords();
//计算取得总页数
if (totalRecords % recordRows == 0) {
pageSize = totalRecords / recordRows;
}
else {
pageSize = (totalRecords / recordRows) + 1;
}
String tempPage = request.getParameter("currentPage");
if (tempPage != "" && tempPage != null) {
currentPage = Integer.parseInt(tempPage);
}
String goPage = request.getParameter("goPage");
if (goPage != null) {
if (!goPage.equals("")) {
currentPage = Integer.parseInt(goPage);
}
}
//确认各页的起始和结束留言记录
int startRecord = recordRows*(currentPage - 1);
int stopRecord = startRecord + recordRows;
if (currentPage == pageSize) {
stopRecord = totalRecords;
}
out.write("\r\n");
out.write("\r\n");
if (currentPage > pageSize) {
out.write("\r\n");
out.write("<script type=\"text/javascript\">\r\n");
out.write(" alert(\"超过当前最多页数!\");\r\n");
out.write(" </script>");
currentPage = 1;
startRecord = 0;
stopRecord = recordRows;
}
out.write('\r');
out.write('\n');
if (currentPage < 1) {
out.write("\r\n");
out.write("<script type=\"text/javascript\">\r\n");
out.write(" alert(\"您要查找的页数不能低于1!!!\");\r\n");
out.write(" </script>");
currentPage = 1;
startRecord = 0;
stopRecord = recordRows;
}
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<title>中青网络会所>>留言本</title>\r\n");
out.write("<meta name=\"Robots\" content=\"all\">\r\n");
out.write("<meta name=\"Generator\" content=\"Dreamweaver,ASP\">\r\n");
out.write("<meta name=\"copyright\" content=\"Copyright 中青网络会所 2007-2008\">\r\n");
out.write("<meta name=\"Author\" content=\"zqnet\">\r\n");
out.write("<meta name=\"description\" content=\"中青网络会所留言本\">\r\n");
out.write("<meta name=\"keywords\" content=\"留言本,中青\">\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("<link href=\"css.css\" rel=\"stylesheet\" type=\"text/css\">\r\n");
out.write("\r\n");
out.write("<style type=\"text/css\">\r\n");
out.write(" <!--\r\n");
out.write(" .style14 {color: #666666}\r\n");
out.write(" .style16 {\r\n");
out.write(" color: #0099FF;\r\n");
out.write(" font-weight: bold;\r\n");
out.write(" }\r\n");
out.write(" -->\r\n");
out.write("</style>\r\n");
out.write("<script language=\"JavaScript\" type=\"text/JavaScript\">\r\n");
out.write("<!--\r\n");
out.write("function MM_reloadPage(init) { //reloads the window if Nav4 resized\r\n");
out.write(" if (init==true) with (navigator) {if ((appName==\"Netscape\")&&(parseInt(appVersion)==4)) {\r\n");
out.write(" document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}\r\n");
out.write(" else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();\r\n");
out.write("}\r\n");
out.write("MM_reloadPage(true);\r\n");
out.write("//-->\r\n");
out.write("</script><script type=\"text/javascript\" language=\"javascript\">\r\n");
out.write("function check(){\r\n");
out.write(" gopage=this.go.goPage.value;\r\n");
out.write(" if(gopage==\"\"){\r\n");
out.write(" alert(\"请输入您要跳转到的页面。\");\r\n");
out.write(" this.go.goPage.focus();\r\n");
out.write(" return false;\r\n");
out.write(" }else{\r\n");
out.write(" return true;\r\n");
out.write(" }\r\n");
out.write("}\r\n");
out.write("</script></head>\r\n");
out.write("<body background=\"images/bg_001.gif\" bgproperties=\"fixed\">\r\n");
out.write("<table width=\"680\" height=\"12\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"biao_bdr\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td>\r\n");
out.write(" <img src=\"images/bar_1.gif\" width=\"678\" height=\"20\">\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write("</table>\r\n");
com.netbar.bean.gbBean[] gbbeans = gbdao.getAlldata();
//System.out.println(gbbeans.length);
//String title,content,reply,person,web,mail,qq,face,ip,pcname,time,redate;
//int id;
for (int i = startRecord ,j=1; i < stopRecord; i++,j++) {
int id = gbbeans[i].getGbID();
String title = gbbeans[i].getGbTitle();
String content = gbbeans[i].getGbContent();
String reply = gbbeans[i].getGbReply();
String person = gbbeans[i].getGbPerson();
String web = gbbeans[i].getGbWeb();
String mail = gbbeans[i].getGbMail();
String qq = gbbeans[i].getGbQQ();
String face = gbbeans[i].getGbFace();
String ip = gbbeans[i].getGbIP();
String pcname = gbbeans[i].getGbPcname();
String time = gbbeans[i].getGbTime();
String redate = gbbeans[i].getGbRedate();
//System.out.println(!reply.equals("暂无回复") + "\n\n\n\n\n");
out.write("\r\n");
out.write("<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");
out.write(" <tr>\r\n");
out.write(" <td width=\"140\" rowspan=\"2\" style=\"border-right: 1px solid #d1e0f0;\">\r\n");
out.write(" <table width=\"98%\" height=\"35\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td>\r\n");
out.write(" <div align=\"center\">\r\n");
out.write(" <font style=\"FONT-SIZE: 10pt; FILTER: shadow(color=#C0C0C0); COLOR: #000000; HEIGHT: 1px\">");
out.print(person);
out.write(" </font>\r\n");
out.write(" </div>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write(" <div align=\"center\">\r\n");
out.write(" ");
if(!face.equals("images/admin.gif")){
out.write("\r\n");
out.write(" <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");
out.write(" ");
}else{
out.write("\r\n");
out.write(" <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(" ");
}
out.write("\r\n");
out.write(" <br>\r\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -