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

📄 liblist.jsp

📁 本例利用java和jsp实现电子政务系统中涉及到的档案管理系统。涉及到javabean和jsp的使用技巧。
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="docBList" class="com.csbook.documentsystem.DocBaseMan" scope="page"/>
<jsp:useBean id="docBorrow" class="com.csbook.documentsystem.BorrowMan" scope="page"/>
<jsp:useBean id="docMan" class="com.csbook.documentsystem.DocMan" scope="page"/>
<jsp:useBean id="ce" class="com.csbook.documentsystem.ChangeEncoding" scope="page"/>
<html>
<head>
<title>电子政务档案管理系统</title>
</head>
<body>
<%
   String docBase=request.getParameter("docBase");
   if(docBase==null)
   {
   ArrayList docBases=docBList.getDocBaseList();
   Iterator it=docBases.iterator();
   %>
  <form name="form1" method="get" action="liblist.jsp">
   请选择档案库:
   <select name="docBase">
   <%
   while(it.hasNext()){
   %>
   <option>
   <%=(String)it.next()%>
   </option>
   <%
   }
   %>
	 </select>
        <input type="submit" name="Submit" value="进入">
       </form>
   <%
   }
   else
   {
    String operator=(String)session.getAttribute("userId");
    if(!docBList.isWritableForDocBase(docBase,operator))
    {
    %>
    <jsp:forward page="err.jsp?err=您没有权限管理该档案库"/>
   <%
    }
    docBase=ce.changeCharset(docBase);
%>
<h3 align="center">本档案库中借阅申请列表</h3>
<table width="95%" border="1">
  <tr>
    <td><div align="center">档案名称</div></td>
    <td><div align="center">借阅人</div></td>
    <td><div align="center">操作</div></td>
  </tr>
  <%
  ArrayList applications=docBorrow.getDocList(0);
  Iterator it=applications.iterator();
  StringTokenizer st=null;
  int tempId,tempDoc;
  String curDocBase;
  while(it.hasNext()){
  st=new StringTokenizer((String)it.next());
  tempId=Integer.parseInt(st.nextToken());
  tempDoc=Integer.parseInt(st.nextToken());
  curDocBase=docMan.getDocBaseById(tempDoc);
  curDocBase=ce.changeCharset(curDocBase);
  if(curDocBase.equals(docBase)){
  %>
    <tr>
    <td><div align="center"><%=docMan.getDocNameById(tempDoc)%></div></td>
    <td><div align="center"><%=st.nextToken()%></div></td>
    <td><div align="center"> <a href="libinfo.jsp?id=<%=tempId%>">察看</a></div></td>
  </tr>
  <%
  }
  }
  %>
</table>


<%
    ArrayList borrowed=docBorrow.getDocList(1);
    it=borrowed.iterator();
%>
<h3 align="center">本档案库中已借出列表</h3>
<table width="95%" border="1">
  <tr>
    <td><div align="center">档案名称</div></td>
    <td><div align="center">借阅人</div></td>
    <td><div align="center">操作</div></td>
  </tr>
  <%
  while(it.hasNext()){
  st=new StringTokenizer((String)it.next());
  tempId=Integer.parseInt(st.nextToken());
  tempDoc=Integer.parseInt(st.nextToken());
  curDocBase=docMan.getDocBaseById(tempDoc);
  curDocBase=ce.changeCharset(curDocBase);
  if(curDocBase.equals(docBase)){
  %>
    <tr>
    <td><div align="center"><%=docMan.getDocNameById(tempDoc)%></div></td>
    <td><div align="center"><%=st.nextToken()%></div></td>
    <td><div align="center"> <a href="libinfo.jsp?id=<%=tempId%>">察看</a>
      </div></td>
  </tr>
  <%
  }
  }
  }
  %>
</table>
</body>
</html>

⌨️ 快捷键说明

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