?? usershowsearchbook.jsp
字號:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'UserShowSearchBook.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%
String username = (String)session.getAttribute("username");
ArrayList arraylist = (ArrayList)request.getAttribute("bookarray");
if(arraylist == null)
{
System.out.println("目前書庫中還沒有你要查找的圖書!");
}
else
{
Bean.BookBean book = null; //---這句話寫在這可以---
System.out.println("有圖書!");
%>
<table width="600" height="150" border="1">
<tr>
<td colspan="5"><div align="center">查詢到的圖書如下:</div></td>
</tr>
<%
Iterator<Bean.BookBean> it = arraylist.iterator();
while(it.hasNext())
{
// Bean.BookBean user = null; //---這句話寫在這也可以---
book = it.next();
%>
<tr>
<td width="120" colspan="1" rowspan="4"><img src = "<%=book.getPicroot()%>" width="120" height="150"/></td>
<td width="51" height="33">書號:</td>
<td width="175" ><%=book.getBookID()%></td>
<td width="89">作者:</td>
<td width="231" ><%=book.getAuthor()%></td>
</tr>
<tr>
<td height="37">書名:</td>
<td><%=book.getBookName()%></td>
<td>剩余數量:</td>
<td><%=book.getSum()%></td>
</tr>
<tr>
<td height="38">價格:</td>
<td><%=book.getPrice()%> </td>
<td>打折:</td>
<td><%=book.getDiscount()%></td>
</tr>
<tr>
<td>出版社:</td>
<td><%=book.getPress()%></td>
<td colspan="2">
<form action = "/BookShop/Servlet/ShopCarOrSaveServlet" name = "ShopcarOrSave" method = "post">
<table>
<tr><td>
<input type = "text" name = "count" value = "1">
</td><td>
<input type = "submit" name = "SubmitShopCar" value = "添加到購物車">
<input type = "submit" name = "SubmitSave" value = "添加到收藏架">
<input type = "hidden" name = "bookID" value = "<%=book.getBookID()%>">
<input type = "hidden" name = "username" value = "<%=username%>">
<td>
</tr>
</table>
</form>
</td>
</tr>
<%
} // <input type = "hidden" name = "UpdateUserID" value = "<%=user.getID()">
}
%>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -