__ment4.java
上传用户:xjrzjk
上传日期:2022-07-31
资源大小:1585k
文件大小:13k
- /* compiled from JSP: /ment4.jsp
- *
- * This code was automatically generated at 0:09:05 on 2004-5-9
- * by weblogic.servlet.jsp.Jsp2Java -- do not edit.
- */
- package jsp_servlet;
- import java.io.*;
- import java.util.*;
- import javax.servlet.*;
- import javax.servlet.http.*;
- import javax.servlet.jsp.*;
- import javax.servlet.jsp.tagext.*;
- // User imports
- import java.sql.*; //[ /ment4.jsp; Line: 2]
- // built-in init parameters:
- // boolean _verbose -- wants debugging
- // Well-known variables:
- // JspWriter out -- to write to the browser
- // HttpServletRequest request -- the request object.
- // HttpServletResponse response -- the response object.
- // PageContext pageContext -- the page context for this JSP
- // HttpSession session -- the session object for the client (if any)
- // ServletContext application -- The servlet (application) context
- // ServletConfig config -- The ServletConfig for this JSP
- // Object page -- the instance of this page's implementation class (i.e., 'this')
- /**
- * This code was automatically generated at 0:09:05 on 2004-5-9
- * by weblogic.servlet.jsp.Jsp2Java -- do not edit.
- *
- * Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
- */
- public final class __ment4
- extends
- weblogic.servlet.jsp.JspBase
- implements weblogic.servlet.jsp.StaleIndicator
- {
-
- // StaleIndicator interface
public boolean _isStale() {
weblogic.servlet.jsp.StaleChecker sci =(weblogic.servlet.jsp.StaleChecker)(getServletConfig().getServletContext());
java.io.File f = null;
long lastModWhenBuilt = 0L;
if (sci.isResourceStale("/ment4.jsp", 1084032532000L, "WebLogic Server 7.0 Thu Jun 20 11:47:11 PDT 2002 190955 ")) return true;
return false;
}
public static boolean _staticIsStale(weblogic.servlet.jsp.StaleChecker sci) {
java.io.File f = null;
long lastModWhenBuilt = 0L;
if (sci.isResourceStale("/ment4.jsp", 1084032532000L, "WebLogic Server 7.0 Thu Jun 20 11:47:11 PDT 2002 190955 ")) return true;
return false;
}
-
- public void _jspService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
- {
-
- // declare and set well-known variables:
- javax.servlet.ServletConfig config = getServletConfig();
- javax.servlet.ServletContext application = config.getServletContext();
- javax.servlet.jsp.tagext.Tag _activeTag = null;
- // variables for Tag extension protocol
- Object page = this;
- javax.servlet.jsp.JspWriter out;
- javax.servlet.jsp.PageContext pageContext =
javax.servlet.jsp.JspFactory.getDefaultFactory().getPageContext(this, request, response, null, true, 8192, true);
- response.setHeader("Content-Type", "text/html; charset=GBK");
out = pageContext.getOut();
JspWriter _originalOut = out;
- javax.servlet.http.HttpSession session = request.getSession(true);
-
-
- try { // error page try block
response.setContentType("text/html; charset=GBK");
out.print("rn");
out.print("rn");
//[ /ment4.jsp; Line: 3]
try{ //[ /ment4.jsp; Line: 4]
String productList = (String)request.getSession(true).getAttribute("productList"); //[ /ment4.jsp; Line: 5]
String strFlags = "尚未处理"; //[ /ment4.jsp; Line: 6]
if (productList == null || productList.equals("")){ //[ /ment4.jsp; Line: 7]
response.sendRedirect("nothing.jsp"); //[ /ment4.jsp; Line: 8]
} //[ /ment4.jsp; Line: 9]
//数据库连接 //[ /ment4.jsp; Line: 10]
Class.forName("oracle.jdbc.driver.OracleDriver"); //[ /ment4.jsp; Line: 11]
String strUrl = "jdbc:oracle:thin:@slight:1521:LOCAL"; //[ /ment4.jsp; Line: 12]
String strUser = "eshop"; //[ /ment4.jsp; Line: 13]
String strPassword = "eshop"; //[ /ment4.jsp; Line: 14]
Connection con = DriverManager.getConnection(strUrl, strUser, strPassword); //[ /ment4.jsp; Line: 15]
Statement st = con.createStatement(); //[ /ment4.jsp; Line: 16]
//保存购买者信息 //[ /ment4.jsp; Line: 17]
//获得定单号 //[ /ment4.jsp; Line: 18]
String sql = "select max(nvl(form_id,0))+1 as formid from orderlist"; //[ /ment4.jsp; Line: 19]
ResultSet rs = st.executeQuery(sql); //[ /ment4.jsp; Line: 20]
long longId = 0; //[ /ment4.jsp; Line: 21]
if (rs.next()){ //[ /ment4.jsp; Line: 22]
longId = rs.getLong("formid"); //[ /ment4.jsp; Line: 23]
} //[ /ment4.jsp; Line: 24]
rs.close(); //[ /ment4.jsp; Line: 25]
String strUserId = request.getParameter("UserId"); //[ /ment4.jsp; Line: 26]
strUserId = new String(strUserId.getBytes("iso8859-1"),"gb2312"); //[ /ment4.jsp; Line: 27]
String strName = request.getParameter("Name"); //[ /ment4.jsp; Line: 28]
strName = new String(strName.getBytes("iso8859-1"),"gb2312"); //[ /ment4.jsp; Line: 29]
String strZip = request.getParameter("Zip"); //[ /ment4.jsp; Line: 30]
strZip = new String(strZip.getBytes("iso8859-1"),"gb2312"); //[ /ment4.jsp; Line: 31]
String strPhone = request.getParameter("Phone"); //[ /ment4.jsp; Line: 32]
strPhone = new String(strPhone.getBytes("iso8859-1"),"gb2312"); //[ /ment4.jsp; Line: 33]
String strEmail = request.getParameter("Email"); //[ /ment4.jsp; Line: 34]
strEmail = new String(strEmail.getBytes("iso8859-1"),"gb2312"); //[ /ment4.jsp; Line: 35]
String strPays = request.getParameter("Pays"); //[ /ment4.jsp; Line: 36]
strPays = new String(strPays.getBytes("iso8859-1"),"gb2312"); //[ /ment4.jsp; Line: 37]
String strRemark = request.getParameter("Remark"); //[ /ment4.jsp; Line: 38]
strRemark = new String(strRemark.getBytes("iso8859-1"),"gb2312"); //[ /ment4.jsp; Line: 39]
String strAddress = request.getParameter("Address"); //[ /ment4.jsp; Line: 40]
strAddress = new String(strAddress.getBytes("iso8859-1"),"gb2312"); //[ /ment4.jsp; Line: 41]
sql = "insert into orderlist values(" + longId + ",'" + strUserId +"','"+ //[ /ment4.jsp; Line: 42]
strName + "','" + strZip + "','" + strPhone + "','" + strEmail + "','" + //[ /ment4.jsp; Line: 43]
strAddress + "','" + strPays + "',sysdate,'" + strFlags + "','" + strRemark + "')"; //[ /ment4.jsp; Line: 44]
st.executeUpdate(sql); //[ /ment4.jsp; Line: 45]
sql = "select * from product where product_id in (" + productList + ") order by product_no"; //[ /ment4.jsp; Line: 46]
rs = st.executeQuery(sql); //[ /ment4.jsp; Line: 47]
ResultSet rs1 = null; //[ /ment4.jsp; Line: 48]
Statement st1 = con.createStatement(); //[ /ment4.jsp; Line: 49]
long longId1 = 0; //[ /ment4.jsp; Line: 50]
String strProductName = ""; //[ /ment4.jsp; Line: 51]
String strProductId = ""; //[ /ment4.jsp; Line: 52]
double dbPrice = 0; //[ /ment4.jsp; Line: 53]
while (rs.next()){ //[ /ment4.jsp; Line: 54]
int Quatity = 0; //[ /ment4.jsp; Line: 55]
strProductId = rs.getString("product_id"); //[ /ment4.jsp; Line: 56]
String strQuatity = (String)request.getSession(true).getAttribute(strProductId); //[ /ment4.jsp; Line: 57]
//[ /ment4.jsp; Line: 58]
if (strQuatity == null || strQuatity.equals("")){ //[ /ment4.jsp; Line: 59]
Quatity = 1; //[ /ment4.jsp; Line: 60]
}else{ //[ /ment4.jsp; Line: 61]
Quatity = Integer.parseInt(strQuatity); //[ /ment4.jsp; Line: 62]
if (Quatity <=0){ //[ /ment4.jsp; Line: 63]
Quatity = 1; //[ /ment4.jsp; Line: 64]
} //[ /ment4.jsp; Line: 65]
} //[ /ment4.jsp; Line: 66]
strProductName = rs.getString("product_name"); //[ /ment4.jsp; Line: 67]
//[ /ment4.jsp; Line: 68]
dbPrice = rs.getDouble("p_newprice"); //[ /ment4.jsp; Line: 69]
sql = "select max(nvl(id,0))+1 as id from shoplist"; //[ /ment4.jsp; Line: 70]
rs1 = st1.executeQuery(sql); //[ /ment4.jsp; Line: 71]
if (rs1.next()){ //[ /ment4.jsp; Line: 72]
longId1 = rs1.getLong("id"); //[ /ment4.jsp; Line: 73]
} //[ /ment4.jsp; Line: 74]
rs1.close(); //[ /ment4.jsp; Line: 75]
sql = "insert into shoplist(id,product_id,form_id,product_name,number1,p_newprice,regtime) values(" + //[ /ment4.jsp; Line: 76]
longId1 + ",'" + strProductId + "'," + //[ /ment4.jsp; Line: 77]
longId + ",'" + strProductName + "'," + Quatity + "," + dbPrice + ",sysdate)"; //[ /ment4.jsp; Line: 78]
st.executeUpdate(sql); //[ /ment4.jsp; Line: 79]
} //[ /ment4.jsp; Line: 80]
//request.getSession(true).setAttribute("ProductList", null); //[ /ment4.jsp; Line: 81]
out.print("rn<html>rn<head>rn<title>rn提交成功rn</title>rn<link rel="stylesheet" type="text/css" href="style.css">rn</head>rn<body bgcolor="#ffffff">rn<p align="center">北京市内,货到付款! </p>rn<div align="center">rn <TABLE cellSpacing=0 cellPadding=0 width=341>rn <TR>rn <TD align=middle width="342">rn <TABLE cellSpacing=0 cellPadding=0 width=373 bgColor=#006699>rn <TR>rn <TD height=2 width="113" bgcolor="#006699"></TD>rn <TD height=2 width="256" bgcolor="#006699"></TD>rn </TR>rn </TABLE>rn <div align="center">rn <TABLE cellSpacing=1 width=373 bgColor=#416327 height="123" >rn <TR vAlign=top bgColor=#eeeeee>rn <TD width="373" height="76" colspan="2" bgcolor="#EEEEEE">rn <br />rn 订单提交成功,您的订单号是:");
out.print(String.valueOf(longId)); //[ /ment4.jsp; Line: 107]
out.print("rn <p>我们即可按您的订单发货,请牢记您的订单号,以便查询。请你把钱寄到以下地方!</p>rn </TD>rn </TR>rn <TR bgColor=#eeeeee>rn <TD width="70" height="27" bgcolor="#EEEEEE">汇款地址</TD>rn <TD width="303" height="27" bgcolor="#EEEEEE"> 北京市西大街超人大楼4楼</TD>rn </TR>rn <TR bgColor=#eeeeee>rn <TD width="70" height="27" bgcolor="#EEEEEE">收款人</TD>rn <TD width="303" height="27" bgcolor="#EEEEEE"> **先生</TD>rn </TR>rn <TR bgColor=#eeeeee>rn <TD width="70" height="27" bgcolor="#EEEEEE">帐户</TD>rn <TD width="303" height="27" bgcolor="#EEEEEE"> 中国银行北京支行(0111123)</TD>rn </TR>rn <TR bgColor=#eeeeee>rn <TD width="373" height="27" colspan="2" bgcolor="#EEEEEE">rn <h2 align="center"><input type="button" name="close" value="关闭窗口" onClick="window.close()"></h2>rn </TD>rn </TR>rn </TABLE");
out.print(">rn </div>rn <TABLE cellSpacing=0 cellPadding=0 width=373 bgColor=#006699>rn <TR>rn <TD width=119 height=2 bgcolor="#006699"></TD>rn <TD width=272 height=2 bgcolor="#006699">rn <DIV align=right style="width: 212; height: 19"></DIV>rn </TD>rn </TR>rn </TABLE>rn </TD>rn </TR>rn </TABLE>rn </div>rn rn</body>rn</html>rn");
//[ /ment4.jsp; Line: 145]
}catch(Exception e){ //[ /ment4.jsp; Line: 146]
throw e; //[ /ment4.jsp; Line: 147]
} //[ /ment4.jsp; Line: 148]
} catch (Throwable __ee) {
while (out != null && out != _originalOut) out = pageContext.popBody();
((weblogic.servlet.jsp.PageContextImpl)pageContext).handlePageException((Throwable)__ee);
}
- //before final close brace...
- }
-
-
- }