?? buybook.jsp
字號:
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="incoming/common.jsp"%>
<%@ include file="incoming/check.jsp"%>
<%
String isbn = new String(request.getParameter("isbn").trim().getBytes("ISO-8859-1"));
String buynum = new String(request.getParameter("buynum").trim().getBytes("ISO-8859-1"));
Vector buylist = (Vector)session.getValue("shopcar");
int ismatch = 0;
Book book = new Book(isbn, Integer.parseInt(buynum));
if (buylist == null)
{
buylist = new Vector();
buylist.addElement(book);
}
else
{
for(int i=0; i<buylist.size(); i++)
{
Book _book =(Book)buylist.elementAt(i);
if(_book.getIsbn().equals(book.getIsbn()))
{
_book.setBuynum(_book.getBuynum()+book.getBuynum());
buylist.setElementAt(_book,i);
ismatch = 1;
}
}
if(ismatch==0)
buylist.addElement(book);
}
session.putValue("shopcar", buylist);
response.sendRedirect("shopcar.jsp");
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -