?? order_jsp.java
字號:
package org.apache.jsp.user;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import com.bwm.db.Condb;
import com.bwm.cart.buyList;
import java.util.Vector;
public final class order_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"625\" align=\"center\" >\r\n");
out.write(" <tr>\r\n");
out.write(" <td><img name=\"usercenter_01\" src=\"image/usercenter_01.gif\" width=\"625\" height=\"82\" border=\"0\" alt=\"\"></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td width=\"625\" background=\"image/usercenter_02.gif\">\r\n");
out.write("\t\t<table width=\"600\" height=\"488\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" background=\"\"> \r\n");
out.write(" <tr>\r\n");
out.write("\t\t<td><img name=\"cplist_01_01\" src=\"image/gupic1.gif\" width=\"600\" height=\"50\" border=\"0\" alt=\"\"> </td>\r\n");
out.write("\t\t\t</tr>\r\n");
out.write(" <form action=\"user/clear.jsp\" method=\"post\" name=\"form1\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"429\" valign=\"top\"> \r\n");
out.write(" <table width=\"600\" border=\"1\" align=\"center\" cellpadding=\"0\" cellspacing=\"00\" class=\"tableBorder\"> \r\n");
out.write(" \r\n");
out.write("\t <tr align=\"center\" valign=\"middle\"> \r\n");
out.write(" <td height=\"40\" colspan=\"6\" nowrap background=\"\" class=\"bgcolor\"><font color=\"#FF0000\">\r\n");
out.write(" ");
if(session.getAttribute("username")==null){out.println("您還沒有登錄");}else{out.println(session.getAttribute("username"));}
out.write("</font>,您的購物情況如下所示:(注:如果想刪除商品,請將數量置零后點擊修改按鈕。)\t\t</td> \r\n");
out.write(" </tr> \r\n");
out.write(" \r\n");
out.write(" <tr align=\"center\" valign=\"middle\" class=\"bgcolor\"> \r\n");
out.write(" <td width=\"100\" height=\"21\">序號</td>\r\n");
out.write(" <td width=\"200\" height=\"21\">商品名稱</td> \r\n");
out.write(" <td width=\"100\" height=\"21\">單價</td> \r\n");
out.write(" <td width=\"100\" height=\"21\">數量</td>\r\n");
out.write("\t\t<td width=\"100\" height=\"21\">總金額</td>\r\n");
out.write("\t</tr>\r\n");
out.write("\t\t\r\n");
out.write("\t");
Vector shop=(Vector)session.getAttribute("shop");
int num=0;
int pric=0;
if(shop==null||shop.size()==0){
out.write(" \r\n");
out.write("\t<script language=\"javascript\">\r\n");
out.write("\t\talert(\"購物車中沒有物品\");\r\n");
out.write("\t\twindow.location.href=(\"index.jsp\");\r\n");
out.write("\t</script> \r\n");
out.write("\t");
}else{
for(int i=0;i<shop.size();i++){
buyList mylist=(buyList)shop.elementAt(i);
num=num+mylist.number*mylist.price;
out.write(" \r\n");
out.write(" <tr align=\"center\" valign=\"middle\" class=\"bgcolor\"> \r\n");
out.write(" <td width=\"100\" height=\"21\">");
out.print(i+1);
out.write("</td>\r\n");
out.write(" <td width=\"200\" height=\"21\">");
out.print(mylist.warename);
out.write("</td> \r\n");
out.write(" <td width=\"100\" height=\"21\">¥");
out.print(mylist.price);
out.write("</td> \r\n");
out.write(" <td width=\"100\" height=\"21\">\r\n");
out.write(" <input name=\"num");
out.print(i);
out.write("\" size=\"7\" type=\"text\" class=\"txt_grey\" value=\"");
out.print(mylist.number);
out.write("\"></td> \r\n");
out.write(" <td width=\"100\" height=\"21\">¥");
out.print((mylist.price*mylist.number));
out.write("</td> \r\n");
out.write(" <script language=\"javascript\">\r\n");
out.write("\t\t\t<!--\r\n");
out.write("\t\t\tfunction check(){\r\n");
out.write("\t\t\t\tif(isNaN(form1.num");
out.print(i);
out.write(".value)){\r\n");
out.write("\t\t\t\t\talert(\"請不要輸入非法字符\");\r\n");
out.write("\t\t\t\t\treturn false;\r\n");
out.write("\t\t\t\t\thistory.back();\r\n");
out.write("\t\t\t\t}\r\n");
out.write("\t\t\t\tif(form1.num");
out.print(i);
out.write(".value==\"\"){\r\n");
out.write("\t\t\t\t\talert(\"請輸入修改的數量\");\r\n");
out.write("\t\t\t\t\treturn false;\r\n");
out.write("\t\t\t\t\thistory.back();\r\n");
out.write("\t\t\t\t}\t\r\n");
out.write("\t\t\t}\r\n");
out.write("\t\t\t-->\r\n");
out.write("\t\t</script>\r\n");
out.write("\t");
}
}
out.write(" \r\n");
out.write(" <tr align=\"center\" valign=\"middle\" class=\"bgcolor\">\r\n");
out.write("\t\t<td height=\"21\" colspan=\"4\" align=\"right\">\r\n");
out.write("\t\t\t總合計金額:</td>\r\n");
out.write(" <td height=\"21\" align=\"center\">¥");
out.print(num);
out.write("</td>\r\n");
out.write(" </table></td> \r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"59\" align=\"center\" valign=\"top\" background=\"\"><a href=\"index.jsp\">\r\n");
out.write(" </a><a href=\"index.jsp\">\r\n");
out.write(" <input name=\"Submit\" type=\"submit\" class=\"btn_grey\" value=\"修改\" onClick=\"return check()\">\r\n");
out.write("繼續購物</a>|<a href=\"user/putin.jsp\">清空購物車</a>|<a href=\"user/index.jsp\">去收銀臺</a></td>\r\n");
out.write(" </tr>\r\n");
out.write(" </form>\r\n");
out.write("</table>\r\n");
out.write("\t\t\r\n");
out.write("\t\t</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td><img name=\"usercenter_03\" src=\"image/usercenter_03.gif\" width=\"625\" height=\"4\" border=\"0\" alt=\"\"></td>\r\n");
out.write(" </tr>\r\n");
out.write("</table>\r\n");
out.write("\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -