📄 productlist.jsp
字号:
<%@ page contentType="text/html; charset=gbk" language="java" pageEncoding="GBK"%>
<%@ page import="java.util.Collection"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="com.jspdev.ch12.Product"%>
<jsp:useBean id="productBean" class="com.jspdev.ch12.ProductBean" scope="page"></jsp:useBean>
<!--这个页面用于批量删除的例子-->
<html>
<head>
<title>查看所有商品</title>
<link rel="stylesheet" type="text/css" href="../css/styles.css">
<script type="text/javascript" src="../js/common.js"></script>
</head>
<body>
<center>
<h1>查看所有的商品</h1>
<form name="form2" method="post" action="">
<table border="1" width="80%">
<tr bgcolor="#009966" bordercolor="#990066"><td>ID</td><td>类别</td><td>名称</td><td>出厂商</td><td>价格</td><td>描述</td><td>处理</td></tr>
<%
Collection products = productBean.getAllProduct();
Iterator it = products.iterator();
while(it.hasNext()) {
Product temp = (Product)it.next();
%>
<tr bgcolor="#009966"><td><%=temp.getProductId()%></td><td><%=temp.getCategoryId()%></td><td><%=temp.getName()%></td>
<td><%=temp.getProducer()%></td><td><%=temp.getPrice()%></td><td><%=temp.getDescription()%></td>
<td><a href="deleteProduct_do.jsp?productId=<%=temp.getProductId()%>" >删除/<a href="modifyProduct.jsp?productId=<%=temp.getProductId()%>" >修改</td>
</tr>
<%
}
%>
<tr><td><input type="button" value="返回首页" onclick="returnindex()"></td></tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -