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

📄 bookchange.jsp

📁 一个简单实用的网上书城,可当作原型使用
💻 JSP
字号:
<%@page contentType="text/html"%><%@page pageEncoding="UTF-8"%><%@ page language="java"import="java.sql.*" %><%@ page import="java.text.*" %><%@ page language="java"import="java.net.URLEncoder" %><jsp:useBean class="czm.BookBean" id="book" scope="page"></jsp:useBean><%/*禁止使用浏览器Cache*/response.setHeader("Pragma", "No-cache");response.setHeader("Cache-Control", "no-cache");response.setDateHeader("Expires",0);%><html xmlns="http://www.w3.org/1999/xhtml"><!-- DW6 --><head><%@ include  file="head2.txt" %><SCRIPT language="javaScript"></SCRIPT>    <script language="javascript">        function check(){        if(document.bookchange.chaxun.value==""){                alert("请输入要查找书本的名字呀");                return false;                }          else return true;          }    </script></head> <script language="JavaScript" src="student_left.js"></script>            <%                 if(session.getAttribute("admin_ID")==null)                           {                           response.sendRedirect("AdminWindow.jsp");                           }               %>   <body bgcolor="#C0DFFD"><form name="bookchange"  onsubmit="return check()" action="bookchange.jsp" method="post">   <%         request.setCharacterEncoding("UTF-8");       %>      <%@ include file="head.txt"%>        <td  colspan="6" valign="top"><img src="mm_spacer.gif" alt="" width="50" height="1" border="0" > <table width="100%">        <tr>                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;            输入书名:<input type="text" name="chaxun" id="chaxun" value="" />        <input type="radio" name="mhjq" value="mohu" checked />模糊        <input type="radio" name="mhjq" value="jingque" />精确        <input type="submit" value="查询" name="submit2" />  </td>         </tr>        <tr><td><font color="green">分类:</td>                    <tr>                <td>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <%   String sql="Select distinct book_type from bookInfo";    ResultSet rrs = book.executeQuery(sql);    while(rrs.next()){     	String booktype = rrs.getString("book_type");         String tt=URLEncoder.encode(booktype,"UTF-8");%>        <a href="bookchange.jsp?type=<%=tt%>"><%=booktype%></a>          <%    }%>            </td></tr></tr>             <tr></table><table width="100%" border="1" cellspacing="2" bordercolor="#9999FF">  <tr>     <td width="80"><font color="#3333FF">ISBN</font></td>    <td width="80"><font color="#3333FF">书名</font></td>    <td width="80"><font color="#3333FF">作者</font></td>    <td width="80"><font color="#3333FF">出版社</font></td>    <td width="50"><font color="#3333FF">定价</font></td>        <td width="80">&nbsp;</td>     <td width="80">&nbsp;</td>  </tr><%    String type="";   String bname="";   sql="Select * from bookInfo";   type=request.getParameter("type");   bname=request.getParameter("chaxun");   if(bname!=null)   sql="Select * from bookInfo where bookName like '%"+bname+"%'";   if(type!=null)   sql="Select bookInfo.bookISBN,bookName,bookAuthor,publisher,price from bookInfo,Bookstate where bookInfo.bookISBN=Bookstate.bookISBN and book_type='"+type+"' order by infodate desc";   ResultSet rs = book.executeQuery(sql);  int i=0;    while(rs.next()&&i<10){     	String ISBN = rs.getString("bookISBN");                    i++;%>    <tr>     <td width="60"><%=ISBN%></td>    <td><a href="bookinfo.jsp?ISBN=<%=ISBN%>"><%= rs.getString("bookName")%></A></td>    <td><%= rs.getString("bookAuthor")%></td>    <td><%= rs.getString("publisher")%></td>    <td><%= rs.getString("price")%></td>    <td width="80"><a href="bookupdate.jsp?ISBN=<%=ISBN%>">修改书籍信息</a></td>    <td width="80"><a href="bookdelete.jsp?ISBN=<%=ISBN%>">删除书籍</a></td>  </tr>  <%   }   %></table>     </td>   <tr>        <td width="165">&nbsp;</td>    <td width="50">&nbsp;</td>    <td width="167">&nbsp;</td>    <td width="138">&nbsp;</td>    <td width="50">&nbsp;</td>    <td width="190">&nbsp;</td><td width="100%">&nbsp;</td>  </tr>     </form>    </body></html>

⌨️ 快捷键说明

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