购物界面shop.jsp
初始页面
添加商品后,在session中设置属性,重定向回到shop.jsp,然后根据session的内容显示结果
Cookie设置setMaxAge可以延长session的寿命
清空购物车就是清除session
<%@ page import="javax.jms.Session" %>
<%@ page import="java.util.*" %>
<%@ page import="java.net.URLDecoder" %><%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2019/8/12
Time: 10:37
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>购物</title>
<style>
#big{
margin-left: 200px;
}
.pro img,.pro2 img{
width: 200px;
height: 200px;
display: block;
margin: 20px;
}
a{
border: 2px solid black;
border-radius: 5px;
font-weight: bold;
font-size: 16px;
color: black;
}
a:link{
text-decoration: none;
}
a:visited{
color: black;
}
a:hover{
color: green;
}
a:active{
text-decoration: underline;
}
.pro a{
margin-left: 20px;
background-color: pink;
}
.pro2 a{
margin-right: 20px;
background-color: greenyellow;
}
.pro,.pro2{
float: left;
text-align: center;
}
.rec{
position: relative;
top: 20px;
padding: 20px;
width: 80%;
height: 400px;
border