📄 product.jsp
字号:
<%@ page language="java" import="java.util.*,com.accpedu.LHcompany.dao.*,com.accpedu.LHcompany.entity.*" pageEncoding="gbk"%>
<html>
<head>
<style type="text/css">
#Layer2 {
position:absolute;
width:200px;
height:220px;
left:30px;
top:220;
z-index:1;
}
#Layer3 {
position:absolute;
width:200px;
height:115px;
left:0px;
top:0px;
z-index:1;
}
#Layer4 {
position:absolute;
width:200px;
height:115px;
left:200px;
top:15px;
z-index:1;
border-left:solid;
border-left-width:2px;
border-left-color:#CCFFFF;
}
.STYLE3 {font-family: "宋体"; font-size: 12px; }
.STYLE5 {font-family: "宋体"; font-size: 12px; color: red; }
a{font-family: "宋体"; font-size: 12px; ; text-decoration:none; color:#000000;}
-->
</style>
</head>
<body>
<%@ include file="top.jsp" %>
<div id="Layer2">
<span class="STYLE5">首页>商品展示</span><br>
<div id="Layer3">
<%@ include file="left.jsp" %>
</div>
<%
int x=1;
if(request.getParameter("pages")!=null)
{
x=Integer.parseInt(request.getParameter("pages"));
}
productDao pd=new productDao();
ArrayList<product> al=pd.select(x);
int MaxPages=pd.selectPage();
%>
<div id="Layer4">
<%
for(int i=0;i<al.size();i++)
{
%>
<table>
<tr>
<td>
<table width="493">
<tr>
<td width="180" align="center" valign="middle">
<a href="prodocts.jsp?id=<%=al.get(i).getProductID()%>"><img src="image/<%=al.get(i).getPicture()%>" border="0"></a>
</td>
<td>
<table width="300" border="1" class="bg">
<tr>
<td width="67"><span class="STYLE3">产品名称:</span></td>
<td width="68"><span class="STYLE3"><%=al.get(i).getName() %></span></td>
<td width="70"><span class="STYLE3">产品品牌:</span></td>
<td width="67"><span class="STYLE3"><%=al.get(i).getBrand() %></span></td>
</tr>
<tr>
<td width="67"><span class="STYLE3">产品型号:</span></td>
<td width="68"><span class="STYLE3"><%=al.get(i).getModel() %></span></td>
<td width="70"><span class="STYLE3">产品价格:</span></td>
<td width="67"><span class="STYLE3"><%=al.get(i).getPrice() %>元</span></td>
</tr>
</table>
</td></tr>
</table>
<%} %>
</td></tr>
<tr><td align="center" valign="bottom" class="bg">
<%if(x==1)
{
out.println("上一页");
}else
{%>
<span class="STYLE3"><a href="Product.jsp?pages=<%=x-1 %>">上一页</a>
<%}%>
<%if(x==MaxPages)
{
out.println("下一页");
}else
{%>
<a href="Product.jsp?pages=<%=x+1 %>">下一页</a></span>
<%}%>
</td></tr>
</table>
</div>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -