?? index.jsp
字號:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<jsp:directive.page import="com.hygj.service.*"/>
<jsp:directive.page import="com.hygj.bean.*"/>
<%
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>
<%
ArrayList products=new ProductsService().getAll();
%>
<center>
測試購物車 <a href="showCar.jsp">查看購物車</a><br>
<table border="1" cellspacing="0" bordercolor="blue">
<tr><td>商品編號</td><td>商品名稱</td><td>商品單價</td><td>購買</td></tr>
<%
Iterator it=products.iterator();
while(it.hasNext()){
ProductsBean product=(ProductsBean)it.next();
%>
<tr>
<td><%=product.getProductId() %></td>
<td><%=product.getProductName() %></td>
<td><%=product.getUnitPrice() %></td>
<td><a href="goumai.jsp?productId=<%=product.getProductId() %>">購買</a></td></tr>
<%
}
%>
</table>
</center>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -