图书管理系统:
还书界面1:
<%@ page language="java" contentType="text/ html; charset=UTF-8" pageEncoding="UTF-8" import = "java.util.*"%> <%@page import="bean.reader"%> <%@page import="bean.book"%> <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Insert title here</title> </head> <body> <% reader Areader=(reader)session.getAttribute("Areader"); List<book> Abook=(List<book>)session.getAttribute("Abook"); List<book> Mbook=(List<book>)session.getAttribute("Mbook"); List<book> Pbook=(List<book>)session.getAttribute("Pbook"); session.setAttribute("Abook",Abook); session.setAttribute("Mbook",Mbook); session.setAttribute("Pbook",Pbook); session.setAttribute("Areader",Areader); request.setAttribute("Areader",Areader); request.setAttribute("Abook",Abook); %> <form action="Saddc1.jsp" method="post" onsubmit="return chech(this)"> <table align="center" width="450" border="1"> <tr> <td align="center" colspan="5"> <h2>浏览图书</h2> </td> </tr> <tr aligh="center"> <td>图书编号</td> <td>图书名称</td> </tr> <% for(book p:Mbook){ %> <tr aligh="center"> <td><%=p.getID() %></td> <td><%=p.getName() %></td> <td><a href="huan2.jsp?ID=<%=p.getID()%>">查看详细信息</a></b></td> <br> </tr> <% } %> <td><a href="user.jsp">注销</a></td> <td><a href="loginS.jsp">返回上一级</a></td> </table> </form> </body> </html>
还书界面 2:
<%@ page language="java" contentType="text/ html; charset=UTF-8" pageEncoding="UTF-8" import = "java.util.*"%> <%@page import="bean.reader"%> <%@page import="bean.book"%> <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Insert title here</title> </head> <body> <% reader Areader=(reader)session.getAttribute("Areader"); String ID = request.getParameter("ID"); List<book> Abook=(List<book>)session.getAttribute("Abook"); List<book> Mbook=(List<book>)session.getAttribute("Mbook"); session.setAttribute("Abook",Abook); session.setAttribute("Mbook",Mbook); session.setAttribute("Areader",Areader); session.setAttribute("ID",ID); request.setAttribute("Areader",Areader); %> <form action="Lsevlet?method=huan" method="post" onsubmit="return chech(this)"> <table align="center" width="450" border="1"> <tr> <td align="center" colspan="5"> <h2>浏览图书</h2> </td> </tr> <tr aligh="center"> <td>图书编号</td> <td>图书名称</td> <td>作者</td> <td>出版社</td> <td>可借阅人数</td> </tr> <% for(book p:Abook){ if(p.getID().equals(ID)) { %> <tr aligh="center"> <td><%=p.getID() %></td> <td><%=p.getName() %></td> <td><%=p.getWritter() %></td> <td><%=p.getHome() %></td> <td><%=p.getNum() %></td> <td align="center" colspan="2"> <input type="submit" value="还书"> </td> </tr> <% } } %> <td><a href="user.jsp">注销</a></td> <td><a href="loginS.jsp">返回上一级</a></td> </table> </form> </body> </html>