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

📄 searchbookmsg.jsp

📁 图书管理系统
💻 JSP
字号:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="fuguo.yy1.dto.Book,fuguo.yy1.dto.BookCategory"%>
<%@ page import="fuguo.yy1.dto.BookCategory,fuguo.yy1.bo.BookCategoryBO"%>
<%@ page import="fuguo.yy1.dto.User"%>
<%
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>登录成功</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>
  <center>
    <%
		User user=(User)session.getAttribute("USER");
		if(user==null){		
	%>
		您还没有登录,无权查看该页面!<br>
		请先<a href="<%=path%>/user/userLogin.jsp">登录</a>
		<%}else{%>
			<TABLE align="center" border="0" cellpadding="5" cellspacing="0" width="90%">
				
				<TR>
					<TD colspan="3"><font color="blue" size="10"><i><b>在线图书</b></i></font></td>
				</tr>
				<tr>
					<TD colspan="3" valign="top" bgcolor="blue"></td>
				</tr>					
				<TR height="25px"  bgcolor="#cccccc">
					<TD width="40%" align="right">欢迎您,<%=user.getUserName() %></TD>
					<TD width="30%" align="right"><A href="<%=path%>/user/user.jsp">继续查询</a></TD>
					<TD width="30%" align="right"><A href="<%=path%>/user/userOut.jsp">退出登录</A></TD>
				</TR>
				<tr>
					<TD colspan="4" valign="top" bgcolor="blue"></td>
				</tr>	
				<TR height="30px">
					<td colspan="4"></td>
				</TR>
				<%
				ArrayList al=(ArrayList)request.getAttribute("searchBookList");
				
				if(al!=null&&al.size()>0){				
				%>
				<TR bgcolor="#c0c0c0">
					<TD align="center">图书名</TD>
					<TD align="center">类别</TD>
					<TD align="center">价格</TD>
				</TR>
				<%
				Iterator it=al.iterator();
				while(it.hasNext()){
					Book book=(Book)it.next();
				%>
				<TR>
					<TD width="40%" align="center"><%=book.getBookName() %></TD>
					<%
					BookCategory bookCategory=BookCategoryBO.selectBookCategoryById(book.getBookCategoryId());
					if(bookCategory!=null){
						out.print("<TD width='30%' align='center'>");
						out.print(bookCategory.getCategoryName()+"</TD>");
					}else{
						out.print("<TD width='30%' align='center'>");
						out.print("类别已被删除");
					}%>
					<TD width="30%" align="center"><%=book.getPrice() %>元</TD>
				</TR>
			<%}
			}else{%>	
				<tr>
					<TD colspan="4" align="center" ><font color="red">抱歉,没有您要查询的图书</font></td>
				</tr>
				<%}%>	
			</TABLE>
		<%}%>
    </center>
  </body>
</html>

⌨️ 快捷键说明

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