📄 show.jsp
字号:
<%@page contentType="text/html;charset=gb2312"%>
<%@page import="java.util.*" %>
<%@page import="shopcar.*" %>
<%@page import="shopcar.good.*" %>
<html>
<body>
<%
request.setCharacterEncoding("GBK");
if(request.getParameter("item")!=null && !"".equals(request.getParameter("mount"))){
Good g=new Good();
g.setName(request.getParameter("item"));
g.setMount(Integer.parseInt(request.getParameter("mount")));
Shopcar car=(Shopcar)session.getAttribute("shopcar");
if(car==null) {
car=new Shopcar();
}
car.addGood(g);
session.setAttribute("shopcar",car);
}
%>
<FONT size = 5 COLOR="#CC0000">
<br> You have the following items in your cart:
<ol>
<%
Shopcar c=(Shopcar)session.getAttribute("shopcar");
Object [] a =c.show();
Good g;
for (int i=0; i<a.length; i++) {
g=(Good)a[i];
%>
<li> name:<%=g.getName()%> count:<%=g.getMount()%>
<%
}
%>
</ol>
</FONT>
<hr>
<h1>
<a href="select.html">continue shopping</a>
<br><br>
<a href="edit.jsp">edit my shopcar</a>
</h1>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -