clear.jsp
来自「网上服装店 能让用户在该网站上对物品进行上传购买等操作。该设计为原版」· JSP 代码 · 共 33 行
JSP
33 行
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*"%>
<%@ page import="com.bwm.cart.buyList"%>
<%@ page import="java.util.Vector"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%
Vector shop=(Vector)session.getAttribute("shop");
Vector newshop=new Vector();
for(int i=0;i<shop.size();i++){
String number=request.getParameter("num"+i);
if(number.equals("")){
out.println("<script language='javascript'>alert('数量不能为空');history.back();</script>");
}
buyList mylist=(buyList)shop.elementAt(i);
String num=request.getParameter("num"+i);
int newnum=Integer.parseInt(num);
mylist.number=newnum;
if(newnum!=0)
{newshop.addElement(mylist);}
}
session.setAttribute("shop",newshop);
%>
<script language="javascript">
alert("修改成功");
window.location.href="../order.jsp";
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?