📄 cart_005fsee_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import com.domain.SellGoodsForm;
public final class cart_005fsee_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\r\n\r\n");
com.dao.GoodsDao dao = null;
synchronized (_jspx_page_context) {
dao = (com.dao.GoodsDao) _jspx_page_context.getAttribute("dao", PageContext.PAGE_SCOPE);
if (dao == null){
dao = new com.dao.GoodsDao();
_jspx_page_context.setAttribute("dao", dao, PageContext.PAGE_SCOPE);
}
}
out.write("\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<title>电子商城</title>\r\n\r\n</head>\r\n <link href=\"css/css.css\" rel=\"stylesheet\" type=\"text/css\">\r\n<body>\r\n<table width=\"755\" height=\"150%\" border=\"1\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tr>\r\n <td height=\"119\"><div align=\"center\">\r\n ");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "topOne.jsp", out, false);
out.write("</div> </td>\r\n </tr>\r\n <tr>\r\n <td height=\"50\" align=\"center\" valign=\"middle\">");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "topTwo.jsp", out, false);
out.write("</td>\r\n\r\n </tr>\r\n <tr>\r\n <td height=\"847\"><table width=\"100%\" height=\"100%\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tr>\r\n <td width=\"25%\" height=\"638\" rowspan=\"2\" valign=\"top\">\r\n\r\n\t\t");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "left.jsp", out, false);
out.write("\r\n\r\n\r\n\t\t</td>\r\n <td width=\"75%\" height=\"35\" align=\"center\" valign=\"middle\">我的购物车</td>\r\n\r\n </tr>\r\n <tr>\r\n <td valign=\"top\" height=\"613\">\r\n\r\n\r\n\r\n\r\n\t\t <div align=\"center\"><br>\r\n ");
if(session.getAttribute("cart")==null){
out.write("\r\n 您还没有购物!!!\r\n ");
}else{
out.write("\r\n\r\n </div>\r\n <form method=\"post\" action=\"cart_modify.jsp\" name=\"form\">\r\n\t\t <table width=\"96%\" border=\"1\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#FFFFFF\" bordercolordark=\"#819BBC\" bordercolorlight=\"#FFFFFF\">\r\n <tr>\r\n <td width=\"16%\" height=\"28\"><div align=\"center\">序号</div></td>\r\n <td width=\"23%\"><div align=\"center\">商品的名称</div></td>\r\n <td width=\"22%\"><div align=\"center\">商品价格</div></td>\r\n <td width=\"22%\"><div align=\"center\">商品数量</div></td>\r\n <td width=\"17%\"><div align=\"center\">总金额</div></td>\r\n </tr>\r\n ");
float sum=0;
Vector cart=(Vector)session.getAttribute("cart");
for(int i=0;i<cart.size();i++){
SellGoodsForm form=(SellGoodsForm)cart.elementAt(i);
sum=sum+form.number*form.price;
System.out.print("sum="+sum);
out.write("\r\n <tr>\r\n <td height=\"28\"><div align=\"center\">");
out.print(i+1);
out.write("</div></td>\r\n <td><div align=\"center\">");
out.print(dao.selectOneGoods(new Integer(form.ID)).getName());
out.write("</div></td>\r\n <td><div align=\"center\">");
out.print(form.price);
out.write("元</div></td>\r\n <td><div align=\"center\"><input name=\"num");
out.print(i);
out.write("\" size=\"7\" type=\"text\" value=\"");
out.print(form.number);
out.write("\" onBlur=\"check(this.form)\"></div></td>\r\n <td><div align=\"center\">");
out.print(form.number*form.price);
out.write("元</div></td>\r\n </tr>\r\n\t\t <script language=\"javascript\">\r\n\t\t\t<!--\r\n\t\t\tfunction check(myform){\r\n\t\t\t\tif(isNaN(myform.num");
out.print(i);
out.write(".value) || myform.num");
out.print(i);
out.write(".value.indexOf('.',0)!=-1){\r\n\t\t\t\t\talert(\"请不要输入非法字符\");myform.num");
out.print(i);
out.write(".focus();return;}\r\n\t\t\t\tif(myform.num");
out.print(i);
out.write(".value==\"\"){\r\n\t\t\t\t\talert(\"请输入修改的数量\");myform.num");
out.print(i);
out.write(".focus();return;}\r\n\t\t\t\tmyform.submit();\r\n\t\t\t}\r\n\t\t\t-->\r\n\t\t</script>\r\n ");
}
out.write("\r\n </table>\r\n\r\n </form>\r\n\r\n<table width=\"100%\" height=\"52\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tr align=\"center\" valign=\"middle\">\r\n\t\t<td height=\"10\"> \t\t</td>\r\n <td width=\"24%\" height=\"10\" colspan=\"-3\" align=\"left\"> </td>\r\n\t\t</tr>\r\n <tr align=\"center\" valign=\"middle\">\r\n <td height=\"21\" class=\"tableBorder_B1\"> </td>\r\n <td height=\"21\" colspan=\"-3\" align=\"left\" >合计总金额:¥");
out.print(sum);
out.write("</td>\r\n </tr>\r\n <tr align=\"center\" valign=\"middle\">\r\n <td height=\"21\" colspan=\"2\"> <a href=\"index.jsp\">继续购物</a> | <a href=\"cart_checkOut.jsp\">去收银台结账</a> | <a href=\"cart_clear.jsp\">清空购物车</a> | <a href=\"#\">修改数量</a></span></td>\r\n </tr>\r\n</table>\r\n\r\n");
}
out.write("\r\n</td>\r\n </tr>\r\n </table></td>\r\n </tr>\r\n <tr>\r\n <td height=\"100\"><p align=\"center\"><a href=\"background/managerCheck.jsp\">电子商城客户服务热线:</a>0431-4978981,4978982 传真:0431-4972266<br>\r\n\tCopyRight © 2005 www.mingrisoft.com 吉林省明日科技有限公司<br>\r\n\t本站请使用IE6.0或以上版本 1024*768为最佳显示效果</p></td>\r\n </tr>\r\n</table>\r\n</body>\r\n</html>\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 + -