简单的购物车应用案例 相关代码2
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
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>购买球类页面</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>
<%
request.setCharacterEncoding("utf-8");
if(request.getParameter("b1")!=null)
session.setAttribute("s4", request.getParameter("b1"));
if(request.getParameter("b2")!=null)
session.setAttribute("s5", request.getParameter("b2")) ;
if(request.getParameter("b3")!=null)
session.setAttribute("s6", request.getParameter("b3"));
%>
各类球大甩卖,一律八块:<br>
<form method="post" action="b.jsp">
<p>
<input type="checkbox" name="b1" value="篮球">篮球
<input type="checkbox" name="b2" value="足球">足球
<input type="checkbox" name="b3" value="排球">排球
</p>
<p>
<input type="submit" value="提交" name="x1">
<a href="a.jsp">买点别的</a>
<a href="c.jsp">查看购物车</a>
</p>
</form>
</body>
</html>