__reguser3.java
上传用户:xjrzjk
上传日期:2022-07-31
资源大小:1585k
文件大小:12k
- /* compiled from JSP: /reguser3.jsp
- *
- * This code was automatically generated at 21:23:31 on 2004-4-16
- * 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.*; //[ /reguser3.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 21:23:31 on 2004-4-16
- * by weblogic.servlet.jsp.Jsp2Java -- do not edit.
- *
- * Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
- */
- public final class __reguser3
- 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("/reguser3.jsp", 1080744964000L, "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("/reguser3.jsp", 1080744964000L, "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");
//[ /reguser3.jsp; Line: 3]
try{ //[ /reguser3.jsp; Line: 4]
//数据库连接 //[ /reguser3.jsp; Line: 5]
Class.forName("oracle.jdbc.driver.OracleDriver"); //[ /reguser3.jsp; Line: 6]
String strUrl = "jdbc:oracle:thin:@slight:1521:LOCAL"; //[ /reguser3.jsp; Line: 7]
String strUser = "eshop"; //[ /reguser3.jsp; Line: 8]
String strPassword = "eshop"; //[ /reguser3.jsp; Line: 9]
Connection con = DriverManager.getConnection(strUrl, strUser, strPassword); //[ /reguser3.jsp; Line: 10]
Statement st = con.createStatement(); //[ /reguser3.jsp; Line: 11]
//判断是否有此用户 //[ /reguser3.jsp; Line: 12]
String strUid = request.getParameter("uid"); //[ /reguser3.jsp; Line: 13]
String strSql = "select * from RegUser where UserID='" + strUid + "'"; //[ /reguser3.jsp; Line: 14]
ResultSet rs = st.executeQuery(strSql); //[ /reguser3.jsp; Line: 15]
if(rs.next()){ //[ /reguser3.jsp; Line: 16]
rs.close(); //[ /reguser3.jsp; Line: 17]
response.sendRedirect("loginsb.jsp"); //[ /reguser3.jsp; Line: 18]
return; //[ /reguser3.jsp; Line: 19]
} //[ /reguser3.jsp; Line: 20]
//准备用户注册数据 //[ /reguser3.jsp; Line: 21]
String strName = request.getParameter("name"); //[ /reguser3.jsp; Line: 22]
strName = new String(strName.getBytes("iso8859-1"),"gb2312"); //[ /reguser3.jsp; Line: 23]
String strSex = request.getParameter("sex").trim(); //[ /reguser3.jsp; Line: 24]
strSex = new String(strSex.getBytes("iso8859-1"),"gb2312"); //[ /reguser3.jsp; Line: 25]
String strPwd = request.getParameter("pwd").trim(); //[ /reguser3.jsp; Line: 26]
strPwd = new String(strPwd.getBytes("iso8859-1"),"gb2312"); //[ /reguser3.jsp; Line: 27]
String strQuestion = request.getParameter("question").trim(); //[ /reguser3.jsp; Line: 28]
strQuestion = new String(strQuestion.getBytes("iso8859-1"),"gb2312"); //[ /reguser3.jsp; Line: 29]
String strAnswer = request.getParameter("answer").trim(); //[ /reguser3.jsp; Line: 30]
strAnswer = new String(strAnswer.getBytes("iso8859-1"),"gb2312"); //[ /reguser3.jsp; Line: 31]
String strEmail = request.getParameter("email").trim(); //[ /reguser3.jsp; Line: 32]
String strPhone = request.getParameter("usephone").trim(); //[ /reguser3.jsp; Line: 33]
String strAddr = request.getParameter("haddr").trim(); //[ /reguser3.jsp; Line: 34]
strAddr = new String(strAddr.getBytes("iso8859-1"),"gb2312"); //[ /reguser3.jsp; Line: 35]
String strPostCode = request.getParameter("postcode").trim(); //[ /reguser3.jsp; Line: 36]
//[ /reguser3.jsp; Line: 37]
strSql = "insert into reguser(userid,name,pwd,sex,question,answer,email,usephone,haddr,postcode,regtime) values('" //[ /reguser3.jsp; Line: 38]
+ strUid + "','" //[ /reguser3.jsp; Line: 39]
+ strName + "','" //[ /reguser3.jsp; Line: 40]
+ strPwd + "','" //[ /reguser3.jsp; Line: 41]
+ strSex + "','" //[ /reguser3.jsp; Line: 42]
+ strQuestion + "','" //[ /reguser3.jsp; Line: 43]
+ strAnswer + "','" //[ /reguser3.jsp; Line: 44]
+ strEmail + "','" //[ /reguser3.jsp; Line: 45]
+ strPhone + "','" //[ /reguser3.jsp; Line: 46]
+ strAddr + "','" //[ /reguser3.jsp; Line: 47]
+ strPostCode + "',sysdate)"; //[ /reguser3.jsp; Line: 48]
// out.println(strSql); //[ /reguser3.jsp; Line: 49]
st.executeQuery(strSql); //[ /reguser3.jsp; Line: 50]
//[ /reguser3.jsp; Line: 51]
//[ /reguser3.jsp; Line: 52]
strSql = "select * from reguser where userid='" + strUid + "'"; //[ /reguser3.jsp; Line: 53]
// out.println(strSql); //[ /reguser3.jsp; Line: 54]
rs = st.executeQuery(strSql); //[ /reguser3.jsp; Line: 55]
//[ /reguser3.jsp; Line: 56]
//[ /reguser3.jsp; Line: 57]
out.print("rn<head>rn<link rel="stylesheet" type="text/css" href="style.css">rn</head>rn<BODY bgColor=#ffffff>rn<DIV align=center>rn<TABLE cellSpacing=0 cellPadding=0 width=750>rn <TBODY>rn <TR>rn <TD height=62>rn <DIV align=center><BR>rn");
//[ /reguser3.jsp; Line: 69]
if (rs.next()){ //[ /reguser3.jsp; Line: 70]
out.print("rn <TABLE class=main cellSpacing=1 cellPadding=2 width=602 bgColor=#0099CC height="280">rn <TBODY>rn <TR>rn <TD colSpan=2 width="592" height="18">rn <p align="center"><FONTrn color=#ffffff><B>您的注册信息</B></FONT></p>rn </TD></TR>rn <TR>rn <TD width=129 bgColor=#ffffff align="right" height="25">您的会员帐号: </TD>rn <TD bgColor=#ffffff width="455" height="25">");
out.print(String.valueOf(rs.getString("userid"))); //[ /reguser3.jsp; Line: 81]
out.print(" </TD></TR>rn <TR>rn <TD width=129 bgColor=#ffffff align="right" height="25">您的姓名:</TD>rn <TD bgColor=#ffffff width="455" height="25">");
out.print(String.valueOf(rs.getString("name"))); //[ /reguser3.jsp; Line: 84]
out.print(" </TD></TR>rn <TR>rn <TD width=129 bgColor=#ffffff align="right" height="25"><FONT color=#000000>性别:</FONT></TD>rn <TD bgColor=#ffffff width="455" height="25">");
out.print(String.valueOf(rs.getString("sex"))); //[ /reguser3.jsp; Line: 87]
out.print(" </TD></TR>rn <TR>rn <TD width=129 bgColor=#ffffff align="right" height="26">密码:</TD>rn <TD bgColor=#ffffff width="455" height="26">(保密)</TD></TR>rn <TR>rn <TD width=129 bgColor=#ffffff align="right" height="26">密码提问:</TD>rn <TD bgColor=#ffffff width="455" height="26">");
out.print(String.valueOf(rs.getString("question"))); //[ /reguser3.jsp; Line: 93]
out.print(" </TD></TR>rn <TR>rn <TD width=129 bgColor=#ffffff align="right" height="26">密码答案:</TD>rn <TD bgColor=#ffffff width="455" height="26">");
out.print(String.valueOf(rs.getString("answer"))); //[ /reguser3.jsp; Line: 96]
out.print(" </TD></TR>rn <TR>rn <TD width=129 bgColor=#ffffff align="right" height="26">E-MAIL:</TD>rn <TD bgColor=#ffffff width="455" height="26">");
out.print(String.valueOf(rs.getString("email"))); //[ /reguser3.jsp; Line: 99]
out.print(" </TD></TR>rn <TR>rn <TD width=129 bgColor=#ffffff align="right" height="26">常用电话:</TD>rn <TD bgColor=#ffffff width="455" height="26">");
out.print(String.valueOf(rs.getString("usephone"))); //[ /reguser3.jsp; Line: 102]
out.print(" </TD></TR>rn <TR>rn <TD width=129 bgColor=#ffffff align="right" height="26">收货地址:</TD>rn <TD bgColor=#ffffff width="455" height="26">");
out.print(String.valueOf(rs.getString("haddr"))); //[ /reguser3.jsp; Line: 105]
out.print(" rn </TD></TR>rn <TR>rn <TD width=129 bgColor=#ffffff align="right" height="26">邮编:</TD>rn <TD bgColor=#ffffff width="455" height="26">");
out.print(String.valueOf(rs.getString("postcode"))); //[ /reguser3.jsp; Line: 109]
out.print(" rn </TD></TR>rn </TBODY></TABLE>rn <BR> <input type="button" value="进入商城" name="B4" onclick="window.location.href='index.jsp';">rn</DIV></TD></TR></TBODY></TABLE>rn");
//[ /reguser3.jsp; Line: 114]
} //[ /reguser3.jsp; Line: 115]
out.print("rn</DIV></BODY>rn");
//[ /reguser3.jsp; Line: 118]
}catch(Exception e){ //[ /reguser3.jsp; Line: 119]
e.printStackTrace(); //[ /reguser3.jsp; Line: 120]
} //[ /reguser3.jsp; Line: 121]
} catch (Throwable __ee) {
while (out != null && out != _originalOut) out = pageContext.popBody();
((weblogic.servlet.jsp.PageContextImpl)pageContext).handlePageException((Throwable)__ee);
}
- //before final close brace...
- }
-
-
- }