selectallbookaction_jsp.java

来自「图书管理系统。JSP+Struts(MVC框架)sql2000数据库」· Java 代码 · 共 130 行

JAVA
130
字号
package org.apache.jsp.book;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.util.List;
import com.actionForm.BookForm;
import com.actionForm.BookSortForm;

public final class selectAllBookAction_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=gb2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"", 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\r\n");
      com.dao.BookSortDao bookSortDao = null;
      synchronized (request) {
        bookSortDao = (com.dao.BookSortDao) _jspx_page_context.getAttribute("bookSortDao", PageContext.REQUEST_SCOPE);
        if (bookSortDao == null){
          bookSortDao = new com.dao.BookSortDao();
          _jspx_page_context.setAttribute("bookSortDao", bookSortDao, PageContext.REQUEST_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');

List list=(List)request.getAttribute("list");
String changeNumber=(String)request.getAttribute("number");
int number=Integer.parseInt(changeNumber);
String changeMaxPage=(String)request.getAttribute("maxPage");
int maxPage=Integer.parseInt(changeMaxPage);

      out.write("\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<title>科院图书管理系统--------库存查询</title>\r\n\r\n\r\n</head>\r\n\r\n<body>\r\n<div align=\"center\">\r\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../topOne.jsp", out, true);
      out.write('\r');
      out.write('\n');
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../topTwo.jsp", out, true);
      out.write("\r\n\r\n<table width=\"799\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"Images/upPlace.jpg\">\r\n  <tr>\r\n    <td height=\"21\" class=\"word_black\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您当前的位置-------------图书查询</td>\r\n  </tr>\r\n</table>\r\n<table width=\"799\" height=\"28\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"Images/operationOne.jpg\">\r\n  <tr align=\"center\">\r\n    <td width=\"478\"><span class=\"STYLE4\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;库存查询</span></td>\r\n    <td width=\"321\"><a href=\"bookAction.do?method=selectAllOneBookAction\">以书籍名字或者条形码查询</a></td>\r\n  </tr>\r\n</table>\r\n<table width=\"799\" height=\"457\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tableBorder_B_dashed\">\r\n  <tr>\r\n    <td valign=\"top\" ><div align=\"center\">\r\n      <br>\r\n\t  <table border=\"1\" cellpadding=\"0\" cellspacing=\"0\"  bordercolor=\"#FFFFFF\" bordercolordark=\"#819BBC\" bordercolorlight=\"#FFFFFF\">\r\n        <tr align=\"center\" bgcolor=\"#83B9FF\"  class=\"word_white\" >\r\n");
      out.write("          <td width=\"49\">编号</td>\r\n          <td width=\"130\" height=\"25\" bgcolor=\"#83B9FF\">书名</td>\r\n          <td width=\"85\">作者</td>\r\n\t\t  <td width=\"85\">类别</td>\r\n\t\t  <td width=\"85\">摆放书架</td>\r\n          <td width=\"85\">定价</td>\r\n           <td width=\"85\">库存数量</td>\r\n          <td width=\"130\">出版社</td>\r\n\r\n        </tr>\r\n\t\t");
for(int i=0;i<list.size();i++){
                  BookForm form=(BookForm)list.get(i);
                  BookSortForm sortForm=new BookSortForm();
sortForm.setSortNumber(form.getSortNumber());
BookSortForm bookSortForm=(BookSortForm)bookSortDao.selectbookSort(sortForm);
                  
      out.write("\r\n        <tr align=\"center\" >\r\n          <td height=\"25\">");
      out.print(form.getBookNumber());
      out.write("</td>\r\n          <td><div align=\"left\">&nbsp;<a href=\"bookAction.do?method=selectBookOneAction&bookNumber=");
      out.print(form.getBookNumber());
      out.write('"');
      out.write('>');
      out.write('《');
      out.print(form.getBookName());
      out.write("》</a></div></td>\r\n          <td>");
      out.print(form.getAuthor());
      out.write("</td>\r\n\t\t  <td>");
      out.print(bookSortForm.getSortName());
      out.write("</td>\r\n\t\t   <td>");
      out.print(bookSortForm.getPlaceName());
      out.write("</td>\r\n          <td>");
      out.print(form.getSinglePirce());
      out.write("元</td>\r\n          <td>");
      out.print(form.getBookSum());
      out.write("本</td>\r\n          <td>");
      out.print(form.getPublish());
      out.write("</td>\r\n\r\n        </tr>\r\n\t\t");
}
      out.write("\r\n      </table>\r\n      <table width=\"718\" height=\"22\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n        <tr align=\"left\">\r\n          <td width=\"426\">");
      out.print(number+1);
      out.write('/');
      out.print(maxPage);
      out.write("页</td>\r\n          <td width=\"292\" align=\"right\">\r\n\t\t     ");
if(number>0){
      out.write("\r\n            <a href=\"bookAction.do?method=selectAllBookAction&number=");
      out.print(number-1);
      out.write("\">上一页</a>&nbsp;&nbsp;\r\n            ");
}
      out.write("\r\n\t\t\t");
if(number<maxPage-1){
      out.write("\r\n            <a href=\"bookAction.do?method=selectAllBookAction&number=");
      out.print(number+1);
      out.write("\">下一页</a></td>\r\n          ");
}
      out.write("\r\n\r\n\r\n\r\n        </tr>\r\n      </table>\r\n    </div></td>\r\n  </tr>\r\n</table>");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../bottom.jsp", out, true);
      out.write("\r\n</div>\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 + -
显示快捷键?