📄 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 + -