📄 booklist.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
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">
<style type="text/css">
.book
{
font-size: 13px;
width: 370px;
height: 180px;
float: left;
margin: 5px;
border: none;
background-color: #CCC;
}
.tip
{
text-align: center;
font-weight: bold;
}
</style>
</head>
<body>
<%@ include file="../../../nav.jsp" %>
<div style="width:760px;">
<c:forEach items="${ bookList }" var="book">
<table class="book" border="0">
<tr>
<td rowspan="4" width="90" align="center">
<img src="images/${ book.imagePath }" width="78" height="110" />
</td>
<td class="tip" nowrap="nowrap">标题:</td>
<td>
<c:url var="url" value="book.jsp?isbn=${book.isbn}" />
<b><a href="${url}">${ book.title }</a></b>
</td>
</tr>
<tr>
<td class="tip">简介:</td>
<td>${ book.desc }</td>
</tr>
<tr>
<td class="tip">单价:</td>
<td><fmt:formatNumber value="${ book.price }" pattern="¥#,##0.00" /></td>
</tr>
<tr>
<form action="cart" style="border:none;">
<td colspan="2" align="center">
<input type="hidden" name="op" value="doAdd" />
<input type="hidden" name="isbn" value="${ book.isbn }" />
<input type="submit" value="添加到购物车" />
</td>
</form>
</tr>
</table>
</c:forEach>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -