⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userbuybook.jsp

📁 手工完成
💻 JSP
字号:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@page import="Bean.BookBean"%>
<%@page import="Bean.BuyBookBean"%>
<%
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 'UserBuyBook.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>
  <a href = "LogInSucceed.jsp?user=<%=(String)session.getAttribute("username")%>">返回收页</a>
    <%
    	String username = (String)session.getAttribute("username");
    	Bean.BookBean book = new Bean.BookBean();
    	Bean.BuyBook buybook = new Bean.BuyBook();
    	ArrayList<BookBean> arraylist = buybook.buybookquery(username);
   
   if(arraylist == null)
   {
   	System.out.println("目前书库中还没有你要查找的图书!");
   }
   else
   {
   	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"> 
  </td>
	
  </tr>
 <%
   	} //  <input type = "hidden" name = "UpdateUserID" value = "<%=user.getID()">
   }
%>
</table> 
     %>
  </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -