📄 result.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GB2312"
pageEncoding="GB2312"%>
<%@ page import="java.util.Collection,java.util.Iterator"%>
<%@ page import="com.wxpn.tutorial.ec.bean.ECBook"%>
<%@ include file="../include/header.jsp"%>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=760 align="center">
<TBODY>
<tr>
<td align="left" height=25><%if (session.getAttribute("username") != null) {
out.println(session.getAttribute("username"));
}%> 当前位置:<a href="../index.jsp">首页</a> -> 成员服务</td>
<td align="right"><%@ include file="../include/date.jsp"%></td>
</tr>
<TR bgColor=#3399ff>
<TD height=1 colspan="2"><IMG height=1 src="images/spacer.gif"
width=16></TD>
</TR>
<tr>
<td height=10 colspan="2"><IMG height=1 src="images/spacer.gif"
width=16></td>
</tr>
</TBODY>
</TABLE>
<table align="center" border="0" width="760" cellspacing="0"
cellpadding="0" height="355">
<tr>
<td width="150" height="355" valign="top"><%@ include
file="../include/top_banner.jsp"%></td>
<td width="10" height="100%"></td>
<td width="1" height="100%" bgcolor="#3399ff"></td>
<td width="10" height="100%"></td>
<td width="589" height="331" valign="top" background="images/bg1.gif">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="40%" height="20" bgcolor="#3399ff"> <font
color="#ffffff">标题</font></td>
<td width="15%" height="20" bgcolor="#3399ff"> <font
color="#ffffff">作者</font></td>
<td width="15%" height="20" bgcolor="#3399ff"> <font
color="#ffffff">类别</font></td>
<td width="15%" height="20" bgcolor="#3399ff"> <font
color="#ffffff">价格</font></td>
<td width="15%" height="20" bgcolor="#3399ff"> <font
color="#ffffff">库存</font></td>
</tr>
<%if (request.getAttribute("c") == null) {
%>
<tr>
<td width="" 75%"" colspan=5 bgcolor="#FCFCFC" align=center>还没有任何书籍。</td>
</tr>
<%} else {
Collection c = (Collection) request.getAttribute("c");
if (c == null) {
%>
<tr>
<td width="" colspan=5 bgcolor="#FCFCFC" align=center>还没有任何书籍。</td>
</tr>
<%} else {
int totalPageNum = ((Integer) (request
.getAttribute("totalPageNum"))).intValue();
int currentPage = 1;
if (request.getParameter("page") != null) {
currentPage = Integer.parseInt(request
.getParameter("page"));
}
Iterator iterator = c.iterator();
while (iterator.hasNext()) {
ECBook book = (ECBook) iterator.next();
%>
<tr>
<td width="40%" bgcolor="#FCFCFC"><a
href="ShowBookServlet?id=<%=book.getId()%>&url=read.jsp"><%=book.getName()%></a></td>
<td width="15%" bgcolor="#FCFCFC"><%=book.getAuthor()%></td>
<td width="15%" bgcolor="#FCFCFC"><%=book.getStrCategory()%></td>
<td width="15%" bgcolor="#FCFCFC"><%=book.getPrice()%></td>
<td width="15%" bgcolor="#FCFCFC"><%=book.getStock()%></td>
</tr>
<%}%>
<form name="form1" method="get">
<tr>
<td width="" colspan=5 align=right bgcolor="#EFEFEF"><%String type = request.getParameter("type");
String keyword = request.getParameter("keyword");
String way = request.getParameter("way");
for (int i = 1; i <= totalPageNum; i++) {%> <a
href="SearchBookServlet?page=<%=i %>&type=<%=type %>&keyword=<%=keyword %>&way=<%=way %>">[<%=i%>]</a>
<%}
%>共[<%=request.getAttribute("totalPageNum")%>]页
<input type="hidden" name="keyword" value="<%=keyword %>">
<input type="hidden" name="way" value="<%=way %>">
<input type="text" size="2" name="page" value=""><input type="submit" name="go"
value="Go"></td>
</tr>
</form>
<%}
}
%>
</table>
</td>
</tr>
</table>
<%@ include file="../include/footer.jsp"%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -