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

📄 list.jsp~2~

📁 一个较简单的图书管理系统.rar
💻 JSP~2~
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="thisjsp.listBean.*,
                   java.sql.*,
                  com.borland.dx.sql.dataset.QueryDataSet"%>

<html>
<head>
<title>
list
</title>
</head>
<body link="#551A8B" vlink="#0000EE" alink="#FF0000">
<jsp:useBean id="listBeanId" scope="session" class="thisjsp.listBean" />
<jsp:setProperty name="listBeanId" property="*" />
<form name="form1" method="post" action="">
<div align="center">
          <table width="94%" border="0">
            <tr align="center">
              <td colspan="9" height="29" bgcolor="#0066bb"><font size="+3"><b><font color="#FFFFFF">长沙民政学院图书馆网上查书系统</font></b></font></td>
            </tr>
            <tr>
              <td colspan="9" height="19">按→
                <select name="select">
                  <option selected>书名</option>
                  <option>序号</option>
                  <option>出版社</option>
                </select>
                查询:
                <input type="text" name="textValues" size="15" maxlength="100">
                <input type="submit" name="bt" value="查询">
                <input type="submit" name="bt" value="全部浏览">
                <input type="submit" name="bt" value="第一页">
                <input type="submit" name="bt" value="下一页">
                <input type="submit" name="bt" value="上一页">
                <input type="submit" name="bt" value="最后页">
        <font size="5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
<!----------------------------------------------------------------------------->
<%


try
{
if ("POST".equals(request.getMethod()))
{
    String  b=request.getParameterValues("bt")[0];//获取单击按钮名
            b=new String(b.getBytes("ISO-8859-1"));
    String optSlt=request.getParameterValues("select")[0];//获取查询条件
           optSlt=new String(optSlt.getBytes("ISO-8859-1"));
    String textValues=request.getParameterValues("textValues")[0];
           textValues=new String(textValues.getBytes("ISO-8859-1"));
  if (b.equals("查询"))
  {
      if (optSlt.equals("书名"))
         {
         listBeanId.getListResult(" name like '%"+textValues.trim()+"%'",out);
         }
      else
         if (optSlt.equals("序号"))
         {
         listBeanId.getListResult(" id like '%"+textValues.trim()+"%'",out);
         }
         else
         {
             listBeanId.getListResult(" danWei like '%"+textValues.trim()+"%'",out);
         }
  }
  else
  if (b.equals("全部浏览"))
    {
        listBeanId.getListResult(out);//获得初始结果集

    }
    else
        if (b.equals("第一页"))
        {
           listBeanId.firstPag(out);
        }
        else
           if (b.equals("下一页"))
           {
             listBeanId.nextPage(out);
           }
           else
               if (b.equals("上一页"))
               {
                listBeanId.previousPage(out);
               }
               else//最后一页
               if (b.equals("最后页"))
               {
                  listBeanId.lastPage(out);
               }
  %>

    </td>
    </tr>
    <tr>
      <td width="35" height="17" bgcolor="#0066bb">
        <div align="center"><font color="#FFFFFF"><b>序号</b></font></div>
      </td>
      <td height="17" bgcolor="#0066bb" colspan="3">
        <div align="center"><font color="#FFFFFF"><b>书名&nbsp;&nbsp;(详情请单击书名)</b></font></div>
      </td>
      <td height="17" bgcolor="#0066bb" width="100">
        <div align="center"><font color="#FFFFFF"><b>作者</b></font></div>
      </td>
      <td height="17" bgcolor="#0066bb" colspan="2">
        <div align="center"><font color="#FFFFFF"><b>单价</b></font></div>
      </td>
      <td height="17" bgcolor="#0066bb" colspan="3">
        <div align="center"><font color="#FFFFFF"><b>出版单位</b></font></div>
      </td>
    </tr>
    <tr bgcolor="#CCCCCC">
      <td colspan="9" height="1"></td>
    </tr>
<!----------------------------------------------------------------------------->
<%
 listBeanId.getListPage(out);
%>
<!----------------------------------------------------------------------------->
   </table>
 </div>
<!----------------------------------------------------------------------------->
<%
 }
}
catch(Exception ee)
{
  out.println("Error!");
}
%>
<!----------------------------------------------------------------------------->
</form>
</body>
</html>

⌨️ 快捷键说明

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