主页面效果图如下:
代码如下:
<%@page import="com.zking.entity.Goods"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.zking.dao.GoodsDao"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript">
function gm(bid) {
location.href="dogwc.jsp?bid="+bid;
}
</script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
</head>
<body>
<table class="table table-hover">
<tr>
<td>商品编号</td>
<td>商品名称 </td>
<td>商品单价</td>
<td>商品介绍</td>
<td>商品图片</td>
<td>操作</td>
</tr>
<%
GoodsDao gd = new GoodsDao();
ArrayList<Goods> glist = gd.cxsy();
for(Goods g:glist){
%>
<tr>
<td><%=g.getBid() %></td>
<td><%=g.getBname() %></td>
<td><%=g.getBprice() %></td>
<td><%=g.getBinfo() %