new26.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
if(request.getParameter("b1") != null)
{
session.setAttribute("p4", request.getParameter("b1"));
}
if(request.getParameter("b2") != null)
{
session.setAttribute("p5", request.getParameter("b2"));
}
if(request.getParameter("b3") != null)
{
session.setAttribute("p6", request.getParameter("b3"));
}
%>
<h3>销售各种球类,价格二十元</h3>
<form action="new26.jsp" method="post">
<div>
<input type="checkbox" name="b1" id="b1" value="篮球"><label for="b1">篮球</label>
<input type="checkbox" name="b2" id="b2" value="足球"><label for="b2">足球</label>
<input type="checkbox" name="b3" id="b3" value="排球"><label for="b3">排球</label>
</div>
<div>
<input type="submit" name="btn2" value="提交">
<a href="new25.jsp">买点其它</a>
<a href="new27.jsp">查看购物车</a>
</div>
</form>
</body>
</html>