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

📄 productlist.jsp

📁 使用jsp+Servlet,采用MVC模式,实现了一典型小型电子商务网站的全过程.包括前台和后台的全部功能.适合于初学者学习使用.
💻 JSP
字号:
<%@ page language="java" import="java.util.*" import="com.eshop.page.*" pageEncoding="GB2312"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<jsp:useBean id="conditions" class="java.lang.String" scope="request"/>
<HTML>
	<HEAD>
		<title>产品信息列表</title>
		<LINK href="../css/style.css" type="text/css" rel="stylesheet">
		<script src="../js/string.js" language="JavaScript"></script>
<script language="JavaScript">
<!--
function Jumping(){
  document.PageForm.submit();
  return ;
}

function gotoPage(pagenum){
  document.PageForm.jumpPage.value = pagenum;
  document.PageForm.submit();
  return ;
}
-->
</script>
	</HEAD>
	<%String contextPath=request.getContextPath(); %>
	<body MS_POSITIONING="GridLayout">
		<form id="form1" method="post" action="../product/productManagerList">
			<table height="100%" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
				<TBODY>
			
					<tr>
						<td vAlign="top" width="19" bgColor="#f5f5f5"><IMG src="../images/main_01.gif"></td>
						<td width="1" bgColor="#e0e0e0"><IMG src="../images/space.gif"></td>
						<td class="main02_bg" vAlign="top">
							<table cellSpacing="0" cellPadding="0" width="100%" border="0">
							<tr><br></br></tr>
							<tr><br></br></tr>
								<tr align="center">
									<TD  width="100%">
									商品类别:
					  	<input type="text" name="category1" value="${SearchForm.category}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						产品名称:
						<input type="text" maxlength="60" name="name1" value="${SearchForm.productName}">&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="submit" name="submit" value="搜索">
									
									</TD>
								</tr>
								
								<tr>
								<TD class="main02_top" width="100%">&nbsp;</TD>
								</tr>
								
							</table>
							<table style="HEIGHT: 35px" cellSpacing="0" cellPadding="0" width="100%" border="0">
								<tr>
									<td vAlign="bottom" width="40" height="35"><IMG src="../images/dot21.gif"></td>
									<td vAlign="bottom">产品信息列表 &nbsp;&nbsp;&nbsp;
									<a class="a_main02" href="../product/productAdd">[添加]</a>
									</td>
								</tr>
							</table>
							<table width="100%">
							<tr class="main02_listbg">
							    <td>图书类别</td>
							    <td>产品编号</td>
								<td>产品名称</td>
								<td>产品描述</td>
								<td>修改</td>
								<td>删除</td>
								<td>详细</td>
							</tr>
							<c:forEach var="beans" items="${list}">
							<tr class="main02_listbg2">
							  	<td >${beans.category}</td>
							  	<td >${beans.productid}</td>
								<td >${beans.name}</td>
								<td >${beans.descn}</td>
								<td >
								<a class="a_main02" href="productModify?productid=${beans.productid}">修改</a>
								</td>
								<td >
								<a class="a_main02" href="productDelete?productid=${beans.productid}">删除</a>
								</td>
								<td >
								<a class="a_main02" href="productItemList?productid=${beans.productid}">详细</a>
								</td>
							</tr>
							</c:forEach>
							</table>
						</form>
							<c:if test="${maxPage!=1}">
							<!-- %if(pageCtl.maxPage!=1){%-->
							<form name="PageForm" action="../product/productManagerList" method="post">
							<input type="hidden" name="conditions" value="${conditions}">
							<input type="hidden" name="PageBusiness" value="ProductPage">
							<input type="hidden" name="targetPage" value="viewProduct.jsp">
							<table style="HEIGHT: 8px" cellSpacing="0" cellPadding="0" width="100%" align="left" border="0"
								class="main02_table">
								<tr class="main02_listbg">
									<td style="WIDTH: ; HEIGHT: 10px" align="center">
									${rowsPerPage}个记录每页||总记录:${maxRowCount}||当前页:${curPage }||总页数:${maxPage }||
									<c:if test="${curPage==1}">
											<img  height=19 align=absMiddle   border=0 src="<%=contextPath%>/images/goFirst.gif">
											<img  height=19 border=0 align=absMiddle  src="<%=contextPath%>/images/goPrev.gif">
									</c:if>
									<c:if test="${curPage!=1}">
											<A HREF="javascript:gotoPage(1)"><img border=0 height=19 src="<%=contextPath%>/images/goFirst.gif" align=absMiddle class="img_btn"></A>
											<A HREF="javascript:gotoPage(${curPage-1 })">
											<img  height=19 src="<%=contextPath%>/images/goPrev.gif" align=absMiddle  border=0 class="img_btn">
											</A>			
									</c:if>
									<c:if test="${curPage==maxPage}">
										<img border=0 align=absMiddle height=19 src="<%=contextPath%>/images/goNext.gif"> <img border=0 align=absMiddle height=19 src="<%=contextPath%>/images/goLast.gif">
									</c:if >
									<c:if test="${curPage!=maxPage}">
										<A HREF="javascript:gotoPage(${curPage+1})"><img  height=19 src="<%=contextPath%>/images/goNext.gif"  border=0 class="img_btn" align=absMiddle ></A>
										<A HREF="javascript:gotoPage(${maxPage })"><img height=19 src="<%=contextPath%>/images/goLast.gif"   border=0 class="img_btn" align=absMiddle ></A>
									</c:if>
									跳到第
								<SELECT name="jumpPage" onChange="Jumping()">
								<c:forEach var="i" begin="1" end="${maxPage}">
								<c:if test="${i==curPage}">
									<OPTION selected value="${i}">${i}</OPTION>
								</c:if>
								<c:if test="${i!=curPage}">
									<OPTION selected value="${i }">${i}</OPTION>
								</c:if>
								</c:forEach >
								</SELECT>
									</td>
								</tr>
							</table>
							</form>
							</c:if>
		</table>

	</body>
</HTML>

⌨️ 快捷键说明

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