目录
-
商品显示
-
加入购物车
商品显示
![](https://i-blog.csdnimg.cn/blog_migrate/71e2b36db654bc7ab71ea3ccff9426c7.png)
代码:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!-- 引入 -->
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>主界面</title>
<style type="text/css">
#likes{
width: 200px;
background: red;
height: 200px;
text-align: right;
display: inline;
/* border:1 slid red ; */
}
</style>
<link type="text/css" rel="stylesheet" href="css/style.css" />
</head>
<body>
<div id="header" class="wrap">
<div id="logo">卓京信息网上书城</div>
<div id="navbar">
<div class="userMenu">
<ul>
<li class="current"><a href="index.jsp">User首页</a></li>
<li><a href="queryorders.do">我的订单</a></li>
<li><a href="Cart.do">购物车</a></li>
<li><a href="#">注销</a></li>
</ul>
</div>
<form method="get" name="search" action="indexServlet.do">
搜索:<input class="input-text" type="text" name="strName" /><input class="input-btn" type="submit" name="submit" value="" />
</form>
</div>
<!-- 搜索提示 div -->
<div id="likes" ></div>
</div>
<div id="content" class="wrap">
<div class="list bookList">
<form method="post" name="shoping" action="Cart.do">
<table>
<tr class="title">
<th class="checker"></th>
<th>书名</th>
<th class="price">价格</th>
<th class="store">库存</th>
<th class="view">图片预览</th>
<th>操作</th>
</tr>
<c:if test="${empty GoodsList }">
<jsp:forward page="indexServlet.do"></jsp:forward>
</c:if>
<c:forEach items="${GoodsList }" var="goods">
<tr id="${goods.gid }">
<td><input type="checkbox" name="bookId" value="${goods.gid }" /></td>
<td class="title">${g