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

📄 show.jsp

📁 基于MVC架构实现的购物车功能
💻 JSP
字号:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@page import="com.lyh.common.DBConnection"%>
<%@page import="com.lyh.entity.FoodBean"%>
<%@page import="com.lyh.dao.GetDataBean;"%>

<%
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>
    <title>show.html</title>
    <link rel="stylesheet" type="text/css" href="../css/styles.css">
	<script language="javascript">
	function displayDate()
	{
		var nowDate=new Date();
		document.getElementById("myTime").value=nowDate.getYear()+"年"+(nowDate.getMonth()+1)+"月"+nowDate.getDate()+"日";
	}
	
	</script>

  </head>
  
  <body onload="displayDate()">
    <center>
  <div style="width:98%;position:relative;border:1px solid red;">
  	<div style="width:98%;height:150px;border:1px solid green;">
  		<div style="width:35%;float:left;height:100px;border:1px solid green"><img src=""></div>
  		<div style="width:64%;float:left;display:inline; height:100px;text-align:center;border:1px solid green"><br><br><h2>我学我会,网上订餐系统</h2></div>
  		<div style="width:99%;height:50px;border:1px solid green;float:left;text-align:middle;"><br>|网站首页|关于我们|订餐帮助|网上订餐|客服中心|</div>
  	
  	</div>
  	
  	
  	<div style="width:98%;position:relative;height:400px;border:1px solid blue;">
  		<div style="width:35%;float:left;height:400px;border:1px solid blue;">
  			<img src="">
  			<p></p>
  			<hr>
  			<p>
  			<input type="text" id="myTime" size="20px" >
  			</p>
  			<hr>
  			
  		</div>
  		<div style="width:64%;float:left;display:inline;height:400px; border:1px solid blue;";>
  			<div style="width:99%;height:50px;border:1px solid red;"></div>
  			<div style="width:99%;height:50px;border:1px solid red;"></div>
  			<div style="width:99%;height:30px;text-align:right; border:1px solid red;"><img src=""></div>
  			<div style="width:99%;height:270px;border:1px solid red;">
  				<table cellPadding=1 cellSpacing=2 width="100%" align=center border=0>
  				<tbody>
  				<%
  				GetDataBean  getDataBean=new GetDataBean();
  				ArrayList<FoodBean> foods=getDataBean.getFoods();
  				FoodBean currentFood;
  				session.setAttribute("foods",foods);
  				for(int i=0;i<foods.size();i++)
  				{
  					currentFood=(FoodBean)foods.get(i);
  					if(i%2==0)
  					{
  					%>
  					<tr>
  					<%}%>
  			<td>
  						<table cellPadding=0 cellSpacing=0 style="border:1px solid red; width:210px">
  						<tr><td rowspan="3"><img  src='../images/<%=currentFood.getFoodImage()%>' width=90></td><td>菜名:<a href="details.jsp?foodID=<%=currentFood.getFoodID()%>"  ><strong><%=currentFood.getFoodName()%></strong></a></td></tr>
  						<tr><td>价格:<%=currentFood.getFoodPrice()%></td></tr>
  						<tr><td style="">口味:<%=currentFood.getRemark()%></td></tr>
  						<tr><td colspan="2">编号:<%=currentFood.getFoodID()%></td></tr>
  					    </table>
  			</td>
  					<%
  					if(i%2==1)
  					{
  					%>
  					</tr>
  					<% 
  					}
  		}%>
  				</tbody>
  				</table>
  			</div>
  		</div>
  	</div>
  	<div style="width:98%;position:relative;height:50px;border:1px solid yellow;">
  	版权
  	</div>
  </div>
  </center>
  </body>
</html>

⌨️ 快捷键说明

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