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

📄 bookdetail.jsp

📁 用java写的网上售书系统 功能详尽 支持各种类别书目查询 分页显示 购物车的暂存功能 内部附有数据库
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%@ page language="java" pageEncoding="gb2312"%> 
<%@page import="java.sql.*" %>
<%@page import="java.util.*" %>
<jsp:useBean id="alogin" class="login.jdbcBean" scope="page"/>
<link href="myCss.css" rel="stylesheet" type="text/css" />
<title>无标题文档</title>
</head>

<%
String bookID=request.getParameter("bookID");
ResultSet rs;
rs=alogin.executeQuery("select * from books where bookID = '"+bookID+"'");
String  bookName=null,publisher=null,price=null,vipPrice=null,inDate=null,author=null,frontPage=null,bookView=null,remark=null;
if(rs.next()){
bookName=rs.getString("bookName");
publisher=rs.getString("publisher");
price=rs.getString("price");
vipPrice=rs.getString("vipPrice");
inDate=rs.getString("inDate");
frontPage=rs.getString("frontPage");if(frontPage==null){frontPage=("pic/wutu.gif");}
author=rs.getString("author");
bookView=rs.getString("bookView");
remark=rs.getString("remark");
}%>

<%
if(request.getParameter("action")!=null){
ArrayList<String> arraylist;
if(session.getAttribute("arraylist")!=null){
arraylist=(ArrayList)session.getAttribute("arraylist");
}
else{ arraylist=new ArrayList<String>();}
arraylist.add(bookID);
session.setAttribute("arraylist",arraylist);%>
<script language="javascript"> 
alert("<%=bookName%>已放入购物车");
</script>
<%} %>




<body class="myCss">
<table width="750" border="0" cellpadding="0" cellspacing="0" class="myCss">
  <!--DWLayoutTable-->
  <tr>
    <td height="37" colspan="4"><div>
      <div align="left">
        <p>&nbsp;</p>
        <p>所选书籍-----------&gt;<%=bookName %></p>
        <p>&nbsp;</p>
      </div>
    </div></td>
    <td width="178"><div>
      <div align="right">
      <%if(session.getAttribute("userName")!=null){ %>
      <p>&nbsp;</p>
        <form id="form1" name="form1" method="post" action="bookDetail.jsp?bookID=<%=bookID%>">
          <img src="images/04dd_car.gif" width="19" height="16" />
          <label>
          <input name="action" type="submit" class="myCss" value="放入购物车" id="action"/>
          </label>
                </form>
        <p>
          <label></label>
          <a href="buyList.jsp" target="_blank"><img src="images/lookbcar.gif" width="100" height="20" border="0" class="myCss" /></a></p>
        <%}%>
      </div>
    </div></td>
  </tr>
  <tr>
    <td width="32" height="200">&nbsp;</td>
    <td width="140" valign="top"><img src=<%=frontPage%> width="140" height="200" /></td>
    <td width="57">&nbsp;</td>
    <td width="343" valign="top"><p>书籍编号 : <%=bookID%> </p>
    <p>书籍名称 : <%=bookName%> </p>
    <p>出 版 社 : <%=publisher%>  </p>
    <p>出版日期 :  <%=inDate%>   </p>
    <p>作 者 : <%=author%>   </p>
    <p>价格 : <%=price%>  </p>
    <p>会员价:<%=vipPrice%> </p>    </td>
    <td></td>
  </tr>
</table>
<div>
  <p>&nbsp;</p>
  <p>书藉简介:</p>
  <p>&nbsp;<%=bookView%></p>
  <p>书籍备注:</p>
  <p>&nbsp;<%=remark%></p>
</div>
</body>
</html>

⌨️ 快捷键说明

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