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

📄 comparelist.jsp

📁 电子商务网站使用MVC模式B/S结构功能不是很全适合初学者看
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312"%>
<%@page import="java.util.Hashtable"%>
<%@page import="java.util.ArrayList" %>
<style type="text/css">
<!--
.style3 {color: #000000}
-->
</style>
<center>
<table width="450"  border="1" >

<%
//	out.print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br>");
	ArrayList shopList=(ArrayList)session.getAttribute("compareList".toUpperCase());
	String id="",card="",num="",model="",photo="",special="",net="",price="",picture="",commodityNum="";
	int totalPrice=0;
	if(shopList!=null)
	for(int i=0;i<shopList.size();i++){
		Hashtable table=(Hashtable)shopList.get(i);
		id=table.get("id".toUpperCase()).toString();
		//System.out.println("!!!!!!!!!!!!!!!!!!"+id);
		card=table.get("card".toUpperCase()).toString();
		num=table.get("num".toUpperCase()).toString();
		model=table.get("model".toUpperCase()).toString();
		photo=table.get("photo".toUpperCase()).toString();
		special=table.get("special".toUpperCase()).toString();
		net=table.get("net".toUpperCase()).toString();
		picture=request.getContextPath()+"/image/phone/"+card+"/"+num+"/"+table.get("picture".toUpperCase()).toString();
		price=table.get("price".toUpperCase()).toString();
		price=price.substring(0,price.indexOf("."));
		commodityNum=table.get("commodityNum".toUpperCase()).toString();
		totalPrice+=Integer.parseInt(price)*Integer.parseInt(commodityNum);
		session.setAttribute("totalPrice".toUpperCase(),totalPrice);
%>
<%
			if(i%2==0){
				out.print("<tr><td align=\"center\">");
			}else{
				out.print("<td align=\"center\">");
			}
%>		<table>
			<tr>
				<td bgcolor="#669900">
					<img src="<%=request.getContextPath()%>/image/biaoge_jiantou.jpg" width="45"><%=card%>
					:<%=num%>
			</tr>
			<tr>
				<td>
					<TABLE cellSpacing=0 cellPadding=0 width=450 border=0 >
					  <TBODY>
					  <TR vAlign=top >
						<TD width=170 height="42">
						  <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
							<TBODY>
							<TR align=middle>
							  <TD height=42><A 
										href="<%=request.getContextPath()%>/clientShowOneCommodityAction?id=<%=id%>"
									  target=_blank><IMG 
								src="<%=picture%>" width=169 height=160 align="top"></a></TD>
							</TR>
							</TBODY>
						  </TABLE>
						</TD>
						<TD width=280  bgColor=#f9f6ed>
							<table>

										<tr>
											<td height="25"><img src="<%=request.getContextPath()%>/image/biaoge_jiantou.jpg" width="45">&nbsp;手机款式:<%=model%></td>
										</tr>
										<tr>
											<td height="25"><img src="<%=request.getContextPath()%>/image/biaoge_jiantou.jpg" width="45">&nbsp;手机照相:<%=photo%></td>
										</tr>
										<tr>
											<td height="25"><img src="<%=request.getContextPath()%>/image/biaoge_jiantou.jpg" width="45">&nbsp;手机特点:<%=special%></td>
										</tr>

										<tr>
											<td height="25"><img src="<%=request.getContextPath()%>/image/biaoge_jiantou.jpg" width="45">&nbsp;网络制式:<%=net%></td>
										</tr>
										<tr>
											<td height="25"><img src="<%=request.getContextPath()%>/image/biaoge_jiantou.jpg" width="45">&nbsp;手机价格:<%=price%>(元)</td>
										</tr>
										<tr bgColor=#eeeeee>
											<TD height=25 align="center">
											  <a href="<%=request.getContextPath()%>/clientShopAction?id=<%=id%>">放入购物车</a>&nbsp;
											  <a href="<%=request.getContextPath()%>/removeOneCompareAction?id=<%=id%>">移出对比</a>&nbsp;
											</td>
										</tr>
									</table>
				
				</Td>
			</tr>
		</table>
			 

<%
			if(i%2==0){
				out.print("</td>");
			}else{
				out.print("</td></tr>");
			}
%></TABLE>
<%
	 }
 %>
</table>
<table width="400">
	<tr>
		<td>
			<a href="<%=request.getContextPath()%>/endCompareAction">清空对比</a>
		</td>
		<td><a href="javascript:window.close()">关闭</a></td>
	</tr>
</table>
</center>





⌨️ 快捷键说明

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