图书管理系统:
图书模糊查询界面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"); System.out.println(Areader.getName()); request.setAttribute("Areader",Areader); session.setAttribute("Areader",Areader); %> <form action="Lsevlet?method=seach" method="post" onsubmit="return chech(this)"> <table align="center" width="450"> <tr> <td align="center" > <h2>图书模糊查询</h2> <hr> </td> </tr> <td> <input type="radio" name="user" value="书名" checked="checked">书名 <input type="radio" name="user" value="作者">作者 </td> <tr> <td align="right">查询:</td> <td><input type="text" name="name"/></td> </tr> <tr> <td align="center" colspan="2"> <input type="submit" value="确认"> </td> </tr> <tr align="center"><a href="user.jsp">注销</a></tr> <br> <tr align="center"><a href="loginM.jsp">返回上一级</a></tr> <br> </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)request.getAttribute("Areader"); List<book> Abook=(List<book>)request.getAttribute("Abook"); List<book> Abook1=(List<book>)request.getAttribute("Abook1"); System.out.println(Areader.getName()); for(book p:Abook) { System.out.println(p.getName()); } session.setAttribute("Abook",Abook); 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> <td>作者</td> <td>出版社</td> <td>可借阅人数</td> </tr> <% for(book p:Abook1){ %> <tr aligh="center"> <td><%=p.getID() %></td> <td><%=p.getName() %></td> <td><%=p.getWritter() %></td> <td><%=p.getHome() %></td> <td><%=p.getNum() %></td> <br> </tr> <% } %> <td><a href="user.jsp">注销</a></td> <td><a href="loginR.jsp">返回上一级</a></td> </table> </form> </body> </html>