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

📄 displaycategory.jsp

📁 一个小型的JSP购物网站
💻 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 'DisplayCategory.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">
		<table width="333">
			<tr>
				<td>
					<img src="mm_spacer.gif" alt="" width="100" height="1" border="0" />
				</td>
				<td colspan="2">
					<c:if test="<%=request.getParameter("cid") != null%>">
						<fieldset>
							<legend><%=request.getParameter("cid")%></legend>
							<hr size="1px">
							<table>

								<c:forEach var="row" items="${requestScope.smll}">
									<tr>
										<td>
											<fieldset>
												<a href="servlet/ProductsCategoryServlet?scid=${row.scid}"><c:out
														value="${row.sname}"></c:out>
												</a>
											</fieldset>
										</td>
									</tr>
									<tr>
										<td>
											<hr size="1px">
										</td>
									</tr>
								</c:forEach>
							</table>

							<hr size="1px" color="green">
						</fieldset>
					</c:if>
					<c:if test="<%=request.getParameter("scid") != null%>">
						<fieldset>
							<legend><%=request.getParameter("sname")%></legend>
							<hr size="1px">
							<table>

								<c:forEach var="row" items="${requestScope.pro}">
									<tr>
										<td>
											<fieldset>
												<c:out value="${row.pname}"></c:out>
											</fieldset>
										</td>
										<td>
											<fieldset>
												<c:out value="¥${row.pprice}"></c:out>
											</fieldset>
										</td>
										<td>
											<c:if
												test="<%=request.getSession().getAttribute("users") == null%>">
												<a href="servlet/MyShopperCartServlet"
													onClick="return check()" title="购买"> <img
														src="Images\pic_myshopping.gif" border="0">
												</a>
											</c:if>
											<c:if
												test="<%=request.getSession().getAttribute("users") != null%>">
												<a
													href="servlet/MyShopperCartServlet?pid=${row.pid}&cate=true"
													title="购买"> <img src="Images\pic_myshopping.gif"
														border="0">
												</a>
											</c:if>
										</td>
									</tr>
									<tr>
										<td>
											<hr size="1px">
										</td>
									</tr>
								</c:forEach>
							</table>
							
							<hr size="1px" color="green">
						</fieldset>
					</c:if>
				</td>
			</tr>
		</table>
	</body>
</html>

⌨️ 快捷键说明

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