📄 goodslist.jsp
字号:
<%@ page language="java" pageEncoding="gb2312"%>
<%@ page import="java.util.*" %>
<%@ page import="domain.*" %>
<%@ page import="dataservice.*" %>
<%
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">
-->
</head>
<body BGCOLOR="00AAFF">
<h1 align="center">商品列表</h1>
<div align="center">
<table border="2">
<tr>
<th>商品名称</th>
<th>商品价格</th>
<th>库存量</th>
<th>卖方</th>
<th>类别信息</th>
<th>添加到购物车</th>
</tr>
<%
GoodService gs = new GoodService();
ArrayList<Goods> goodses = gs.getAllGoodInfo();
for (int i = 0; i < goodses.size(); i++) {
%>
<tr>
<td><%=goodses.get(i).getName() %></td>
<td><%=goodses.get(i).getPrice() %></td>
<td><%=goodses.get(i).getNumber() %></td>
<td><%=goodses.get(i).getSaler().getId() %></td>
<td><%=goodses.get(i).getCategory(0)+"->" + goodses.get(i).getCategory(1) + "->" + goodses.get(i).getCategory(2) %></td>
<td><a href="./user/addtocart.jsp?id=<%=goodses.get(i).getId() %>">添加</a></td>
</tr>
<%
}
%>
</table>
</div>
<a href="./user/userhome.jsp">返回主页</a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -