?? mainbody.jsp
字號:
<%@ page language="java" pageEncoding="gbk"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
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>
<script type="text/javascript" language="javascript">
function check()
{
alert("請登陸后再購買商品!!\n\n如果登陸后還不能購買請刷新頁面.");
return false;
}
</script>
<base href="<%=basePath%>">
<title>My JSP 'MainBody.jsp' starting page</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" href="mm_health_nutr.css" type="text/css" />
</head>
<body bgcolor="#F4FFE4">
<c:set var="down" value="下架"></c:set>
<form action="" method="get">
<table width="444">
<tr>
<td colspan="4"><br/></td>
</tr>
<tr>
<td><img src="mm_spacer.gif" alt="" width="100" height="1" border="0"/></td>
<td colspan="2">
<table width="600">
<tr align="center" height="38">
<td>商品編號</td>
<td>商品名稱</td>
<td>商品價格</td>
<td>所屬類別</td>
<td>庫存量</td>
<td>圖片</td>
<c:if test="<%=request.getParameter("manager")!=null %>">
<td>當前狀態</td>
<c:if test="<%=request.getParameter("manager_up")!=null || request.getParameter("manager_down")!=null %>">
<td>更改狀態</td>
</c:if>
<c:if test="<%=request.getParameter("modify")!=null%>">
<td>操作</td>
</c:if>
</c:if>
<c:if test="<%=request.getParameter("manager")==null %>">
<td>放入購物車</td>
</c:if>
</tr>
<tr><c:if test="<%=request.getParameter("manager")!=null %>">
<td colspan="8"><hr size="1px"></td></c:if>
<c:if test="<%=request.getParameter("manager")==null %>">
<td colspan="7"><hr size="1px"></td></c:if></tr>
<c:forEach var="row" items="${requestScope.Products}">
<tr align="center" valign="top">
<td><c:out value="${row.pid}"></c:out></td>
<td><c:out value="${row.pname}"></c:out></td>
<td><c:out value="${row.pprice}"></c:out></td>
<c:forEach var="small" items="${requestScope.smallca}">
<c:if test="${small.scid==row.smallcid}">
<td><c:out value="${small.sname}"></c:out></td>
</c:if>
</c:forEach>
<td><c:out value="${row.amount}"></c:out></td>
<td width="60" align="center">
<!-- 判斷是說明情況下的操作 -->
<c:if test="<%=request.getParameter("manager_up")!=null %>">
<a href="servlet/BodyServlet?manager=true&manager_up=true&page=${pro.currentIndex}" target="body"
onClick="javascript:window.open('../servlet/PictureServlet?pic=${row.pid}','','toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=300,height=222');">查看</a>
</c:if>
<c:if test="<%=request.getParameter("manager")==null %>">
<a href="servlet/BodyServlet?page=${pro.currentIndex}" target="body"
onClick="javascript:window.open('../servlet/PictureServlet?pic=${row.pid}','','toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=300,height=222');">查看</a>
</c:if>
<c:if test="<%=request.getParameter("manager_down")!=null %>">
<a href="servlet/BodyServlet?manager=true&manager_down=true&page=${pro.currentIndex}" target="body"
onClick="javascript:window.open('../servlet/PictureServlet?pic=${row.pid}','','toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=300,height=222');">查看</a>
</c:if>
<c:if test="<%=request.getParameter("modify")!=null %>">
<a href="servlet/BodyServlet?manager=true&modify=true&page=${pro.currentIndex}" target="body"
onClick="javascript:window.open('../servlet/PictureServlet?pic=${row.pid}','','toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=300,height=222');">查看</a>
</c:if>
</td>
<c:if test="<%=request.getParameter("manager")!=null %>">
<td><c:out value="${row.pstatus}"></c:out></td>
</c:if>
<c:if test="<%=request.getParameter("manager_up")!=null %>">
<c:if test="${row.pstatus==down}">
<td><a href="servlet/ManagerOperatorRackServlet?pid=${row.pid}&up=true"><c:out value="上架"></c:out></a></td>
</c:if>
</c:if>
<c:if test="<%=request.getParameter("manager_down")!=null %>">
<c:if test="${row.pstatus!=down}">
<td><a href="servlet/ManagerOperatorRackServlet?pid=${row.pid}&down=true"><c:out value="下架"></c:out></a></td>
</c:if>
</c:if>
<c:if test="<%=request.getParameter("modify")!=null %>">
<td><a href="servlet/ManagerModifyProductsServlet?pid=${row.pid}&modify=true"><c:out value="修改"></c:out></a></td>
</c:if>
<c:if test="<%=request.getParameter("manager")==null %>">
<td width="60" align="center">
<c:if
test="${sessionScope.users==null}">
<a href="servlet/MyShopperCartServlet" onClick="return check()"><img
src="Images\pic_myshopping.gif" border="0">
</a>
</c:if>
<c:if
test="${sessionScope.users!=null}">
<a href="servlet/MyShopperCartServlet?pid=${row.pid}"><img
src="Images\pic_myshopping.gif" border="0">
</a>
</c:if>
</td>
</c:if>
</tr>
<tr><c:if test="<%=request.getParameter("manager")!=null %>">
<td colspan="8"><hr size="1px"></td></c:if>
<c:if test="<%=request.getParameter("manager")==null %>">
<td colspan="7"><hr size="1px"></td></c:if>
</tr>
</c:forEach>
</table>
</td>
</tr>
<tr align="center">
<td></td>
<td>
<c:if test="${sessionScope.pro!=null}">
<c:if test="<%=request.getParameter("manager")==null %>">
<a href="servlet/BodyServlet?page=1" Target="body">首頁</a>
<a href="servlet/BodyServlet?page=${pro.currentIndex-1}" Target="body">上一頁</a>
<a href="servlet/BodyServlet?page=${pro.currentIndex+1}" Target="body">下一頁</a>
<a href="servlet/BodyServlet?page=${pro.maxPage}" Target="body">尾頁</a>
當前第${pro.currentIndex}頁 共有${pro.maxPage}頁
</c:if>
</c:if>
<c:if test="<%=request.getParameter("manager_up")!=null %>">
<a href="servlet/BodyServlet?page=1&manager=true&manager_up=true" Target="body">首頁</a>
<a href="servlet/BodyServlet?page=${pro.currentIndex-1}&manager=true&manager_up=true" Target="body">上一頁</a>
<a href="servlet/BodyServlet?page=${pro.currentIndex+1}&manager=true&manager_up=true" Target="body">下一頁</a>
<a href="servlet/BodyServlet?page=${pro.maxPage}&manager=true&manager_up=true" Target="body">尾頁</a>
當前第${pro.currentIndex}頁 共有${pro.maxPage}頁
</c:if>
<c:if test="<%=request.getParameter("manager_down")!=null %>">
<a href="servlet/BodyServlet?page=1&manager=true&manager_down=true" Target="body">首頁</a>
<a href="servlet/BodyServlet?page=${pro.currentIndex-1}&manager=true&manager_down=true" Target="body">上一頁</a>
<a href="servlet/BodyServlet?page=${pro.currentIndex+1}&manager=true&manager_down=true" Target="body">下一頁</a>
<a href="servlet/BodyServlet?page=${pro.maxPage}&manager=true&manager_down=true" Target="body">尾頁</a>
當前第${pro.currentIndex}頁 共有${pro.maxPage}頁
</c:if>
<c:if test="<%=request.getParameter("modify")!=null %>">
<a href="servlet/BodyServlet?page=1&manager=true&modify=true" Target="body">首頁</a>
<a href="servlet/BodyServlet?page=${pro.currentIndex-1}&manager=true&modify=true" Target="body">上一頁</a>
<a href="servlet/BodyServlet?page=${pro.currentIndex+1}&manager=true&modify=true" Target="body">下一頁</a>
<a href="servlet/BodyServlet?page=${pro.maxPage}&manager=true&modify=true" Target="body">尾頁</a>
當前第${pro.currentIndex}頁 共有${pro.maxPage}頁
</c:if>
</td>
</tr>
</table>
</form>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -