📄 browse.jsp
字号:
<%@ taglib prefix="c" uri="/WEB-INF/c.tld"%>
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.util.*"%>
<%@ page import="com.ascenttech.ebookstore.bean.*"%>
<%@ page import="com.ascenttech.ebookstore.shopcart.*"%>
<html>
<head>
<title>
浏览图书
</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="css/mycss.css" rel="stylesheet" type="text/css" />
</head>
<body leftmargin=0 topmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<div class="top"></div>
<div class="main1"></div>
<div class="main2"><center>
<p> </p>
<p> </p>
<p><a href="<%=request.getContextPath()%>/querybook.jsp">继续查询</a>
<a href="<%=request.getContextPath()%>/showcart.jsp">查看购物车</a>
</p>
<table border=1>
<%
if(!request.getAttribute("type").equals("BY_ISBN")){
Collection c = (Collection)request.getAttribute("book");
Iterator itc = c.iterator();
while(itc.hasNext()){
Book book = (Book)itc.next();
%>
<tr>
<td><%=book.getIsbn()%></td>
<td><%=book.getTitle()%></td>
<td><%=book.getAuthor()%></td>
<td><%=book.getPrice()%></td>
<td><a href="shoppingcart?operation=addItem&isdn=<%=book.getIsbn()%>">加入购物车</a></td>
</tr>
<%
}
%>
</table>
<%
}else{
BookDetails book=new BookDetails();
book=(BookDetails)request.getAttribute("book");
if(book==null){ %>
<span class="bodytxt">对不起,本书店没有你要求的书</span><%=request.getAttribute("key")%>
<%
return;}
else {
%>
</p>
<p class="bodyh1">你的查询结果是: </p>
<table border=1>
<tr>
<td class="bodytxt">ISBN</td>
<td class="bodytxt">书名</td>
<td class="bodytxt">作者</td>
<td class="bodytxt">价格</td>
</tr>
<tr>
<c:set var="bookitem" value="${requestScope.book}"/>
<td><c:out value="${bookitem.isbn}" /></td>
<td><c:out value="${bookitem.title}" /></td>
<td><c:out value="${bookitem.author}"/></td>
<td><c:out value="${bookitem.price}"/></td>
<td><a href="shoppingcart?operation=addItem&isdn=<c:out value="${bookitem.isbn}" />">加入购物车</a></td>
</tr>
<%
}
}
%>
</table>
</center>
<div class="txt">版权所有:亚思晟科技(C)2005-2008 </div>
</div>
<div class="main3"></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -