⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 goodslist.jsp

📁 JavaBean+Jsp 开发的《手机商城系统》
💻 JSP
字号:
<%@ page language="java" import="java.util.*,com.test.ps.util.*,com.test.ps.goods.*" pageEncoding="UTF-8"%>
<%
	int cateId=Integer.parseInt(request.getParameter("cateId"));
	int parId=Integer.parseInt(request.getParameter("parId"));	
	String pageNum="0";
	if(request.getParameter("page")==null){
		pageNum="1";
		}
	else
		pageNum=(String)request.getParameter("page");
	GoodsAction action=new GoodsAction();
 %>  
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>

<LINK href="../img/adminStyle.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
.STYLE2 {font-weight: bold}
-->
</style>
</head>

<body>
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td height="80" colspan="3">
    <jsp:include page="../adminTop.jsp" flush="true"/></td>
  </tr>
  <tr>
      <td colspan="3" height="30" bgcolor="#e6f3ff"><span class="STYLE2 STYLE2"><a href="../adminRight.jsp">首页</a>&gt;<a href="categoryParList.jsp">品牌列表</a>&gt;<a href="categorySonList.jsp?parId=<%=parId%>">型号列表</a>&gt;商品列表</span></td>
  </tr>
	 <tr>
      <td colspan="3" height="30"><hr size="5" color="#e6f3ff" /></td>
    </tr>  
  <tr>
    <td height="30"><h1>商品列表</h1></td>
  </tr>
  <tr>
    <td height="30" valign="top">
	<table width="95%" border="0" cellspacing="2" cellpadding="0">
		<tr>
			<td height="30" colspan="4" bgcolor="CBEDFE"><a href="goodsAdd.jsp?categoryId=<%=cateId%>&amp;parId=<%=parId%>">&mdash;&mdash;添加商品&mdash;&mdash;</a></td>
	  	</tr>
	<%
	PageData pagedata=action.getPageData(pageNum,cateId);
	if(pagedata==null){
		out.print("<tr><td align='center'><div align='center'>该类别下无商品!</div></td></tr>");
	}else{
		ArrayList<Goods> goodList=pagedata.getData();
		Iterator<Goods> i=goodList.iterator();
		int page1=pagedata.getCurPage();
		while(i.hasNext()){
			Goods good=(Goods)i.next();
	%>
		<tr height="80">
			<td width="200" bgcolor="#F8FCFC"><div align="center"><%=good.getGoodsName()%></div></td>
			<td width="100" bgcolor="#F8FCFC"><div align="center"><a href="goodsInf.jsp?goodsCode=<%=good.getGoodsCode()%>">查看商品</a></div></td>
			<td width="100" bgcolor="#F8FCFC"><div align="center"><a href="goodsChange.jsp?categoryId=<%=good.getCategoryId()%>&amp;parId=<%=parId%>&amp;goodsCode=<%=good.getGoodsCode()%>">修改商品</a></div></td>
			<td width="100" bgcolor="#F8FCFC"><div align="center"><a href="goodsDelete.jsp?goodsCode=<%=good.getGoodsCode()%>&amp;categoryId=<%=good.getCategoryId()%>&amp;parId=<%=parId%>" onclick="return confirm('确实要删除此商品吗?')">删除商品</a></div></td>
		</tr>
		<tr>
		  <td colspan="4" height="3"><hr size="1" color="#5B889D"/></td>
		</tr>
	<%}%>
		<tr><td colspan="4">
			<table width="100%"  border="0" align="right" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td>&nbsp;</td>
					<td width="20%">第<%=pagedata.getCurPage()%>页</td>
					<td width="20%">共<%=pagedata.getTotalPage()%>页</td>
					<%if(page1>1) {%>
					<td width="15%"><a href="goodsList.jsp?page=1&amp;cateId=<%=cateId %>&amp;parId=<%=parId%>">首页</a></td>
					<td width="15%"><a href="goodsList.jsp?page=<%=page1-1 %>&amp;cateId=<%=cateId %>&amp;parId=<%=parId%>">上页</a></td>
					<%}
					if(page1<pagedata.getTotalPage()){%>
					<td width="15%"><a href=     "goodsList.jsp?page=<%=page1+1 %>&amp;cateId=<%=cateId %>&amp;parId=<%=parId%>">下页</a></td>
					<td width="15%"><a href="goodsList.jsp?page=<%=pagedata.getTotalPage() %>&amp;cateId=<%=cateId %>&amp;parId=<%=parId%>">尾页</a></td>
					<%}
				}%>	
				</tr>
	</table>   
		</td></tr>
	</table>
</td>
  </tr>

  <tr>
      <td><hr align="left" size="10" noshade color="#318EB7"></td>
    </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -