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

📄 producttop.jsp

📁 本文论述了一个前台笔记本销售系统的开发过程
💻 JSP
字号:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@ page import= "com.set.appframe.data.GenericValueObject" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<%
List productTop10=null;
List noticeList=null;
List productList=null;
if(request.getAttribute("productTop10")!=null){
   productTop10=(List)request.getAttribute("productTop10");
}
if(request.getAttribute("noticeResult")!=null){
   noticeList=(List)request.getAttribute("noticeResult");
}
if(request.getAttribute("product")!=null){
   productList=(List)request.getAttribute("product");
}

String username="";
if(request.getSession().getAttribute("USERNAME")!=null){
username=(String)request.getSession().getAttribute("USERNAME");
}

 %>

<html>
	<head>
		<TITLE>笔记本销售电子商务网站</TITLE>
		<LINK href="home/john_shop.css" type=text/css rel=stylesheet>
	</head>	
<script type="text/javascript">
function view(entity){
 document.location.href="/product/ProductAction.do?dispatch=view&productid="+entity;
}
function onShopping(entity){
     var username="<%=username%>";
     if(username==""){
        alert("请先登陆才能拥有属于您自己的购物车!");
     }else{
        window.open("/shopping/ShoppingAction.do?dispatch=create&productId="+entity, "newwindow", "height=400, width=500, toolbar =no, menubar=no scrollbars=yes resizable=no");	    
     
     }
}
</script>
	<body  text=#000000 leftMargin=0 background="image/background.gif"
		topMargin=0 marginheight="0" marginwidth="0">
<form name=frmPage action="" method="post">
		<jsp:include page="../common/Top_head.jsp?tab=menuKey1" flush="false"></jsp:include>	

		<TABLE width=100% border=0>
			<tr>
				<td width="20%" align="center" valign=top>
					<table width=100%>					
						<tr>
							<td width="100%" valign=top>
								<jsp:include page="../home/load.jsp" flush="false"></jsp:include>
							</td>
						</tr>
					
						<tr >
							<td width="100%" height="24" style="background-color: #CCCCFF;">
								<div align="center" class="style1">
									最新公告
								</div>
							</td>
							</TR>
							<%
							   if(noticeList!=null){
							      for(int i=0;i<noticeList.size();i++){
							         GenericValueObject ngvo=(GenericValueObject)noticeList.get(i);
							 %>
							 <TR>
							  <td>&nbsp;<font color="blue"><%=ngvo.getItemString("CONTENT") %></font></td>
							 <%        
							      }
							   }
							 %>
						</tr>
						
					</table>


				</td>
				<td valign="top">
				<table width="100%" border="0">
				<%
				  for(int i=0;i<productList.size();i=i+2){
				     GenericValueObject gvo1=(GenericValueObject)productList.get(i);
				     GenericValueObject gvo2=(GenericValueObject)productList.get(i+1);			     
				  
				 %>
                  <tr>
                    <td width="31%" rowspan="7" valign="top"><a href="javascript:view('<%=gvo1.getItemString("ID") %>')"><img src="<%=gvo1.getItemString("URL") %>" width="131" height="100" border=0></a></td>
                    <td width="19%" valign="top"></td>
                    <td width="32%" rowspan="7"  valign="top"><a href="javascript:view('<%=gvo2.getItemString("ID") %>')"><img src="<%=gvo2.getItemString("URL") %>" width="131" height="100" border=0></td>
                    <td width="18%" rowspan="4">商品型号:</td>
                  </tr>
                  <tr>
                    <td valign="top"></td>
                  </tr>
                  <tr>
                    <td valign="top"></td>
                  </tr>
                  <tr valign="top">
                    <td height="23" valign="top">商品型号:</td>
                  </tr>
                  <tr valign="top">
                    <td height="33" valign="top"><%=gvo1.getItemString("MODEL") %></td>
                    <td width="18%"><%=gvo2.getItemString("MODEL") %></td>
                  </tr>
                  <tr valign="top">
                    <td height="28" valign="top">价格:<%=gvo1.getItemString("PRICE") %></td>
                    <td width="18%">价格:<%=gvo2.getItemString("PRICE") %></td>
                  </tr>                 
                  <tr valign="top">
                    <td height="31" valign="top" align="right"><a href="javascript:onShopping('<%=gvo1.getItemString("ID") %>')"><img src="../image/buy.gif" width="59" height="24" border=0></a></td>
                    <td height="31" align="right"><a href="javascript:onShopping('<%=gvo2.getItemString("ID") %>')"><img src="../image/buy.gif" width="59" height="24" border=0></a></td>
                  </tr>
                   <%} %>
                   
                 
                </table></td>
				<td width="20%" align="center" valign=top>
					<table width=100%>
						<tr>
							<td width="100%" colspan="2">
								<jsp:include page="../home/search.jsp" flush="false"></jsp:include>
							</td>
						</tr>
						<tr>
							<td height="24" colspan="2" style="background-color: #CCCCFF;">
								<div align="center" class="style1">
									商品销售排行Top10
								</div>
							</td>

						</tr>
						<tr>
							<td width="40%" height="24" align="center">
								<span class="style1">产品型号</span>
							</td>
							<td width="60%" align="center">
								<span class="style1">&nbsp;&nbsp;产品价格</span>
							</td>
						</tr>
						<%
						  if(productTop10!=null){
						   for(int i=0;i<productTop10.size();i++){
						     GenericValueObject pgvo=(GenericValueObject)productTop10.get(i);
						  %>
						  <tr>
						      
						      <td  height="24" align="center">
								<a href="javascript:view('<%=pgvo.getItemString("ID") %>')"><%=pgvo.getItemString("MODEL") %></a>
							   </td>
							    <td align="center">
								<%=pgvo.getItemString("PRICE") %>
							  </td>
						  </tr>
						  <%   
						   }
						  }
						 %>
					</table>


				</td>
			</tr>
		</table>
		<jsp:include page="../home/bottom.jsp" flush="false"></jsp:include>
		</form>
	</body>
</html>
                   

⌨️ 快捷键说明

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