📄 displayfood.jsp
字号:
<%@ page language="java" import="java.util.*,bean.*" pageEncoding="GBK"%>
<%
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>
<base href="<%=basePath%>">
<title>餐品详细信息</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" type="text/css" href="styles.css">
-->
</head>
<body>
<%
List foods = (List) session.getAttribute("foods");
FoodBean bean = null;
String foodId = request.getParameter("foodID");
for (int i = 0; i < foods.size(); i++) {
bean = (FoodBean) foods.get(i);
if (foodId.equals(String.valueOf(bean.getFoodID()))) {
session.setAttribute("foodToAdd", bean);
break;
}
}
%>
<table>
<tr>
<td colspan="3">
<h2>
<%=bean.getFoodName()%>
</h2>
</td>
</tr>
<tr>
<td rowspan="4">
<img height=250 src="../images/<%=bean.getFoodImage() %>" width=300>
</td>
<td align="left">
餐品原料:
</td>
<td align="left">
<%=bean.getRemark()%>
</td>
</tr>
<tr>
<td align="left">
餐品价格:
</td>
<td align="left">
<%=bean.getFoodPrice()%>
</td>
</tr>
<tr>
<td align="left">
餐品介绍:
</td>
<td align="left">
<%=bean.getDescription()%>
</td>
</tr>
<tr align="left">
<td>
<form action="/restrant/servlet/AddFoodToCart" method="post" target="mainFrame">
<input type="submit" value="放入购物车">
</form>
</td>
<td>
<form action="chJsp/viewCart.jsp" method="get" target="mainFrame">
<input type="submit" value="查看购物车">
</form>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -