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

📄 index.jsp

📁 用jsp和servlet技术运用MVC模式做的购物车小系统源码
💻 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 + -