gatherswatchlist_jsp.java

来自「野生动物系统的JAVA源码, 野生动物系统的JAVA源码」· Java 代码 · 共 178 行

JAVA
178
字号
package org.apache.jsp.operation.gather_005fswatch;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import scout.operation.gather_swatch.*;
import scout.util.*;
import java.sql.*;
import scout.util.*;
import scout.database.util.*;

public final class gatherSwatchList_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;

      out.write("\r\n\r\n\r\n\r\n");

GatherSwatchPage page2 = new GatherSwatchPage();

//轮换显示表格的色彩
String color1 = "F7FFEF";
String color2 = "DEFFDE";
String color = "";

      out.write("\r\n<html>\r\n<head>\r\n\r\n<title>国家陆生野生动物疫源疫病监测信息系统</title>\r\n\r\n<script language=\"javascript\" src=\"js/pagination.js\" type=\"\"></script>\r\n<style type=\"text/css\">\r\n<!--\r\n.STYLE1 {font-size: larger}\r\n.STYLE2 {font-family: \"楷体_GB2312\"}\r\n.STYLE10 {font-family: \"楷体_GB2312\"; font-size: 14px; }\r\n.STYLE11 {font-size: 14px; }\r\n-->\r\n</style>\r\n</head>\r\n<body bgcolor=\"#ffffff\">\r\n\r\n<table width=\"88%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t<tr>\r\n\t\t<td height=\"29\" class=\"STYLE2\"><div align=\"center\" class=\"STYLE1\">样本采集记录</div></td>\r\n\t</tr>\r\n</table>\r\n<p class=\"STYLE2\">&nbsp;</p>\r\n<table width=\"70%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n  <tr>\r\n    <td class=\"STYLE2\"><a href=\"gatherSwatch.jsp\">添加新记录</a></td>\r\n    <td align=\"right\" valign=\"middle\" class=\"STYLE10\">请输入查询条件:</td>\r\n    <td valign=\"bottom\" class=\"STYLE2\"><input type=\"text\" name=\"textfield\">\r\n      <label>\r\n      <input type=\"button\" name=\"Submit\" value=\"查询\">\r\n    </label></td>\r\n  </tr>\r\n  <tr>\r\n    <td class=\"STYLE2\">&nbsp;</td>\r\n    <td class=\"STYLE2\">&nbsp;</td>\r\n");
      out.write("    <td class=\"STYLE2\">&nbsp;</td>\r\n  </tr>\r\n</table>\r\n\r\n<table width=\"88%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\r\n  <tr>\r\n    <td width=\"6%\" height=\"21\" class=\"STYLE10\">编号</td>\r\n    <td width=\"29%\" class=\"STYLE10\">动物种类</td>\r\n    <td width=\"8%\" class=\"STYLE10\">采样人</td>\r\n\t<td width=\"8%\" class=\"STYLE10\">采样地点</td>\r\n    <td width=\"8%\" class=\"STYLE10\">精度</td>\r\n\t<td width=\"8%\" class=\"STYLE10\">纬度</td>\r\n\t<td width=\"8%\" class=\"STYLE10\">海拔</td>\r\n\t<td width=\"6%\" class=\"STYLE10\">查看</td>\r\n    <td width=\"6%\" class=\"STYLE10\">修改</td>\r\n  </tr>\r\n  ");

  /** 设置新的分页信息到page2 */
  String pageNum = Tools.formatStr(request.getParameter("jumpPage"));
  System.out.println("Manage页面,获得的页码:"+pageNum);
  if (!pageNum.equals("")) {
    try {
      GatherSwatchPage p1 = new GatherSwatchPage();
      GatherSwatchPage p2 = p1.getResult(pageNum);
      page2 = p2;
    }
    catch (Exception ex) {
      out.print(ex.toString());
    }
  }

  /** 读取数据并显示 */
  String s = String.valueOf(page2.getCurPage());
  System.out.println("Manage页面,当前页码:"+s);
  java.util.Vector v = page2.getResult(s).data;
  java.util.Enumeration e = v.elements();
  //开始显示读取出来的数据。
  int j = 1;
  while (e.hasMoreElements()) {
  Object[] obj = (Object[])e.nextElement();
  color = (j%2==1)?color1:color2;//轮显色彩
  j++;
  
      out.write("\r\n  <tr bgcolor=\"");
      out.print(color);
      out.write("\">\r\n    <td class=\"STYLE10\">");
      out.print(obj[0]);
      out.write("</td>\r\n    <td class=\"STYLE10\">");
      out.print(obj[1]);
      out.write("</td>\r\n    <td class=\"STYLE10\">");
      out.print(obj[2]);
      out.write("</td>\r\n    <td class=\"STYLE10\">");
      out.print(obj[3]);
      out.write("</td>\r\n\t<td class=\"STYLE10\">");
      out.print(obj[4]);
      out.write("</td>\r\n\t<td class=\"STYLE10\">");
      out.print(obj[5]);
      out.write("</td>\r\n\t<td class=\"STYLE10\">");
      out.print(obj[6]);
      out.write("</td>\r\n\t<td class=\"STYLE2\"><a href=\"amentGatherSwatch.jsp?id=");
      out.print(obj[7]);
      out.write("&page=");
      out.print(s);
      out.write("\" class=\"STYLE11\">查看</a></td>\r\n    <td class=\"STYLE2\"><a href=\"amentGatherSwatch.jsp?id=");
      out.print(obj[7]);
      out.write("&page=");
      out.print(s);
      out.write("\" class=\"STYLE11\">修改</a></td>\r\n  </tr>\r\n");
}
      out.write("\r\n\r\n  <tr>\r\n    <td height=\"20\" colspan=\"9\" align=\"center\" bgcolor=\"#CEFFCE\" class=\"td1 STYLE2\">\r\n    <!-- 分页菜单实现 -->\r\n\t\t<form action=\"gatherSwatchList.jsp\" name=\"PageForm\" method=\"POST\">\r\n                ");
if (page2.getMaxPage() != 1 ) {
      out.write("\r\n\t\t每页");
      out.print(page2.rowsPerPage );
      out.write('行');
      out.write(',');
      out.write('共');
      out.print(page2.getMaxRowCount() );
      out.write("行\r\n\t\t第");
      out.print(page2.getCurPage() );
      out.write('页');
      out.write(',');
      out.write('共');
      out.print(page2.getMaxPage() );
      out.write("页\r\n\t\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n\t\t");
if (page2.getCurPage() == 1) {
      out.write("\r\n\t\t首页 上一页\r\n\t\t");
}else{
      out.write("\r\n\t\t<a href=\"javascript:gotoPage(1)\">首页</a>\r\n\t\t<a href=\"javascript:gotoPage(");
      out.print( page2.getCurPage()-1 );
      out.write(")\">上一页</a>\r\n\t\t");
}
      out.write("\r\n\t\t");
if (page2.getCurPage() == page2.getMaxPage()) {
      out.write("\r\n\t\t下一页 尾页\r\n\t\t");
}else{
      out.write("\r\n\t\t<a href=\"javascript:gotoPage(");
      out.print(page2.getCurPage()+1 );
      out.write(")\">下一页</a>\r\n\t\t<a href=\"javascript:gotoPage(");
      out.print(page2.getMaxPage() );
      out.write(")\">尾页</a>\r\n\t\t");
}
      out.write("\r\n\t\t<select name=\"jumpPage\" onChange=\"Jumping()\">\r\n\t\t");

		for (int i = 1; i <= page2.getMaxPage(); i++) {
		  if (i==page2.getCurPage()) {
      out.write("\r\n                  <option selected value=\"");
      out.print(i );
      out.write('"');
      out.write('>');
      out.print(i );
      out.write("</option>\r\n                  ");
}else{
      out.write("\r\n                  <option value=\"");
      out.print(i );
      out.write('"');
      out.write('>');
      out.print(i );
      out.write("</option>\r\n                  ");
}
      out.write("\r\n                ");
}
      out.write("\r\n\t\t</select>\r\n\t    ");
}
      out.write("\r\n      </form>\t</td>\r\n  </tr>\r\n</table>\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 + =
减小字号Ctrl + -
显示快捷键?