bookinfo.jsp

来自「简单实现的商品购物系统」· JSP 代码 · 共 120 行

JSP
120
字号
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:choose>
<c:when test="${sessionScope.userName==null}">
<jsp:include flush="true" page="checkLogin.jsp"/>
</c:when>
<c:otherwise>

<jsp:useBean id="my" class="bookshop.BookInfoBean" scope="page"/>
<%
  String bookid=request.getParameter("bookid");
  String sql="select  * from  bookinformation where bookid="+bookid;
 java.util.Collection coll= my.getPageData(1,1,sql);

%>

<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
	font-size: 18px;
}
.style3 {font-size: 18px}
.style4 {	font-size: 18px;
	font-family: "黑体";
}
-->
</style>
<c:set var="pageid"  value="${requestScope.pageid}" scope="page"/>
<c:set var="totalPage"  value="${requestScope.totalPage}" scope="page"/>
<c:set var="coll"  value="${requestScope.coll}" scope="page"/>
<c:set var="pageSize"  value="${requestScope.pageSize}" scope="page"/>
<jsp:include flush="true" page="scrollDiv.jsp"/>
<jsp:include flush="true" page="main/head.jsp"/>
<div align="center"><img src="images/menunewbook.gif" width="601" height="71"><br>
</div>
<table width="66%" height="555"  border="1" align="center" cellspacing="0" bordercolor="#0099CC">
  <tr>
    <td height="218" valign="top"><p>&nbsp;</p>
<c:forEach var="book" items="<%=coll%>">

      <table width="80%" height="90%"  border="0" align="center" cellspacing="0" bordercolor="#00CCFF">
      <tr>
        <td width="19%" height="29"><div align="left"><font size=2>图书名称:</font></div></td>
        <td width="46%">${book.bookname}</td>
        <td width="35%"><div align="center"><img src="image/tjls.gif" width="137" height="33"></div></td>
      </tr>
      <tr>
        <td height=34 align=center bordercolor="#0099cc"><div align="left"><font size=2>图书作者:</font></div></td>
        <td align=center bordercolor="#0099cc"><div align="left">${book.author}</div></td>
        <td rowspan="6"><div align="center">
          <table width="79%" height="44%"  border="1" cellspacing="8" bordercolor="#666666">
            <tr>
              <td><div align="center"><img src="${book.picture}" width="131" height="168"></div></td>
            </tr>
          </table>
        </div></td>
      </tr>
      <tr>
        <td height=34 align=center bordercolor="#0099cc"><div align="left"><font size=2>热点图书:</font></div></td>
        <td align=center bordercolor="#0099cc"><div align="left">${book.hotbook}<img src="image/hot.gif" width="29" height="17"></div></td>
      </tr>
      <tr>
        <td height=31 align=center bordercolor="#0099cc"><div align="left"><font size=2>图书价格:</font></div></td>
        <td align=center bordercolor="#0099cc"><div align="left">${book.price}元</div></td>
      </tr>
      <tr>
        <td height=32 align=center bordercolor="#0099cc"><div align="left"><font size=2>出版社:</font></div></td>
        <td align=center bordercolor="#0099cc"><div align="left">${book.publish}</div></td>
      </tr>
      <tr>
        <td height=30 align=center bordercolor="#0099cc"><div align="left"><font size=2>库存数量:</font></div></td>
        <td align=center bordercolor="#0099cc"><div align="left">${book.amount}</div></td>
      </tr>
      <c:set var="dd" value="${book.bookclassno}" scope="page"/>
            <jsp:useBean id="myclass" class="bookshop.BookClassBean" scope="page"/>
      <%
        Object id= (Object)pageContext.getAttribute("dd");
        // out.print("类型id"+id);

         String classname=  myclass.getClassNameById(id.toString());
      //   out.print("名称:"+classname);
      %>
      <tr>
        <td height="33"><div align="left"><font size=2>图书类型:</font></div></td>
        <td><%=classname%></td>
      </tr>
          <tr>
        <td height="32"><div align="left"><font size=2>出版时间:</font></div></td>
        <td>${book.regtime}</td>
      </tr>
      <tr>
        <td height="33" colspan="3"><div align="center"><img src="image/brief.gif" width="90" height="20"><img src="image/051.gif" width="49" height="12"></div></td>
      </tr>
      <tr>
        <td height="69" colspan="3"><div align="center">
          <textarea name="textarea" cols="80"  readonly ="true"rows="10">${book.content}</textarea>
        </div></td>
      </tr>
    </table>
</c:forEach>
<p align="center"><font size=2 color=#ffffff><a href="shopservlet?bookid=<%=bookid%>&action=add"><img src="image/buy.gif" align=MIDDLE border=0></a><a href="#" onClick="window.close()"><img src="image/close.gif" border=0
	align=MIDDLE></a></font></p>
<p align="center"><br>
    </p>    </td>
  </tr>
</table>
<p>&nbsp;</p>
  <jsp:include flush="true" page="bookBbsform.jsp"/>
<div align="center"><img src="image/alipay.gif" width="640" height="60">
  </div>
  <div align="center">
  <jsp:include flush="true" page="main/tail.jsp"/>

</div>
</c:otherwise>
</c:choose>

⌨️ 快捷键说明

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