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

📄 showbook.jsp

📁 Tomcat 是一个小型的轻量级应用服务器
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page session="true" %>
<%@ page import="com.bookshop.bean.Books" %>
<%@ page import="com.bookshop.util.StringFormat" %>
<jsp:useBean id="book" scope="page" class="com.bookshop.dao.Booksmn" />
<%
String mesg = "";
int Id=0;
if (request.getParameter("bookid")==null || request.getParameter("bookid").equals("")) {
		mesg = "你要查看的图书不存在!";
} else {
	try {
		Id = Integer.parseInt(request.getParameter("bookid"));
		if (!book.getOnebook(Id)){
	mesg = "你要查看的图书不存在!";
		}
	} catch (Exception e){
		mesg = "你要查看的图书不存在!";
	}
}
%>

<html>
<head>
<title>51网络电子书店 查看图书资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function check()
{
	if (document.form1.amount.value<1){
		alert("你的购买数量有问题");
		document.form1.amount.focus();
		return false;
	}
	return true;
}

</script>
<link rel="stylesheet" href="books.css" type="text/css">
</head>

<body bgcolor="#FFCC99" text="#000000" >
<div align="center">
  <p>倾城书屋<font color="#CC0066">选购图书</font>!</p>
  <%
    		if(!mesg.equals("")){
    		out.println(mesg);
    	  } else {
    		Books bk = (Books) book.getBooklist().elementAt(0);
  %>
  <table width="90%" border="0" cellspacing="2" cellpadding="1">
    <form name="form1" method="post" action="purchase.jsp">
      <tr> 
        <td align="right" width="120">图书名:</td>
        <td><%=bk.getBookName()%></td>
      </tr>
      <tr> 
        <td align="right" width="120">作者:</td>
        <td><%=bk.getAuthor()%></td>
      </tr>
      <tr> 
        <td align="right" width="120">所属类别:</td>
        <td><%=bk.getClassname()%></td>
      </tr>
      <tr> 
        <td align="right" width="120">出版社:</td>
        <td><%=bk.getPublish()%></td>
      </tr>
      <tr> 
        <td align="right" width="120">书号:</td>
        <td><%=bk.getBookNo()%></td>
      </tr>
      <tr> 
        <td align="right" width="120">书价:</td>
        <td><%=bk.getPrince()%></td>
      </tr>
      <tr> 
        <td align="right" width="120" valign="top">内容介绍:</td>
        <td><%=StringFormat.toHtml(bk.getContent())%></td>
      </tr>
      <tr> 
        <td align="right" width="120" valign="top">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td align="right" width="120" valign="top">购买:</td>
        <td> 
          <input type="text" name="amount" maxlength="5" size="3" value="1">
          本</td>
      </tr>
      <tr> 
        <td align="right" width="120" valign="top">&nbsp;</td>
        <td> 
		  <input type="hidden" name="bookid" value="<%=Id %>" >
          <input type="submit" name="Submit" value="购买" onclick="return(check());">
          <input type="reset" name="reset" value="取消">
        </td>
      </tr>    
  </table>
<% } %>
  <br><p><a href="javascript:window.close()">关闭窗口</a></p>
  <table width="100%" border="0" cellspacing="2" cellpadding="2">
    <tr>
      <td align="center">06计算机科学与技术3班<br>
        CopyRight@2009 <br>
        Email:<a href="mailto:dengxianghai2005@163.com">dJinlf112@163.com</a></td>
    </tr>
  </table>
  
</div>
</body>
</html>

⌨️ 快捷键说明

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