📄 booklist.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" errorPage="err.jsp?msg=未知错误" %>
<%@ page import="java.util.*, ebook.*" %>
<jsp:useBean id="bookBean" scope="page" class="ebook.BookBean" />
<% request.setCharacterEncoding("gbk"); %>
<html>
<head>
<title>在线手机商店-手机列表</title>
<style type="text/css">
<!--
.title_1 { font-family: "华文行楷"; font-size: 36px; color: #CC66FF; width: 100%; }
.title_2 { font-family: "华文行楷"; font-size: 24px; color: #000000; width: 100%; }
-->
</style>
</head>
<body bgcolor="#66CCFF"><center>
<jsp:include page="header.jsp" />
<h1 align="center"><font class="title_1">手机列表</font></h1>
<div align="center">
<table width="780" border="1" cellpadding="0" cellspacing="0" bordercolor="#FF9900" background="img/标题-16.jpg">
<!--DWLayoutTable-->
<tr>
<td width="25%" height="60" align="center" valign="middle" background="img/标题-15.jpg">手机名称</td>
<td width="25%" align="center" valign="middle" background="img/标题-15.jpg">手机价格</td>
<td width="25%" align="center" valign="middle" background="img/标题-15.jpg">详细内容</td>
<td width="25%" align="center" valign="middle" background="img/标题-15.jpg">订购</td>
</tr>
<%
Object categoryId = request.getParameter("categoryId");
Object searchBookName = request.getParameter("searchBookName");
Object searchAuthor = request.getParameter("searchAuthor");
Collection books;
if (categoryId != null) {
books = bookBean.getCategoryBooks(Integer.parseInt((String)categoryId));
} else if (searchBookName != null) {
books = bookBean.getBooksByName((String)searchBookName);
} else if (searchAuthor != null) {
books = bookBean.getBooksByAuthor((String)searchAuthor);
} else {
books = bookBean.getAllBooks();
}
Iterator i = books.iterator();
if (! i.hasNext()) {
%>
<tr>
<td height="200" align='center' colspan='5'><font color='red' size="+4">没有找到您要的记录!</font></td>
</tr>
<%
} else {
while (i.hasNext()) {
BookBean book = (BookBean)i.next();
%>
<tr>
<td background="img/标题-16.jpg" align="left"><font face="楷体_GB2312"><%= book.getBookName() %></font></td>
<td background="img/标题-16.jpg" align="left"><font face="楷体_GB2312"><%= book.getPrice() %></font></td>
<TD background="img/标题-16.jpg" align="left">
<a href="bookdetail.jsp?bookId=<%= book.getBookId() %>">
<font face="楷体_GB2312">详细</font>
</a>
</TD>
<TD background="img/标题-16.jpg" align="left">
<a href="shopping.jsp?action=add&bookId=<%= book.getBookId() %>">
<font face="楷体_GB2312">购买</font>
</a>
</TD>
</tr>
<%
}
}
%>
</table>
</div>
</body>
<jsp:include page="footer.jsp" />
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -