__reguser3.java
上传用户:xjrzjk
上传日期:2022-07-31
资源大小:1585k
文件大小:12k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. /* compiled from JSP: /reguser3.jsp
  2. *
  3. * This code was automatically generated at 21:23:31 on 2004-4-16
  4. * by weblogic.servlet.jsp.Jsp2Java -- do not edit.
  5. */
  6. package jsp_servlet;
  7. import java.io.*;
  8. import java.util.*;
  9. import javax.servlet.*;
  10. import javax.servlet.http.*;
  11. import javax.servlet.jsp.*;
  12. import javax.servlet.jsp.tagext.*;
  13. // User imports
  14. import java.sql.*; //[ /reguser3.jsp; Line: 2]
  15. // built-in init parameters:
  16. // boolean             _verbose -- wants debugging
  17. // Well-known variables:
  18. // JspWriter out                  -- to write to the browser
  19. // HttpServletRequest  request    -- the request object.
  20. // HttpServletResponse response   -- the response object.
  21. // PageContext pageContext        -- the page context for this JSP
  22. // HttpSession session            -- the session object for the client (if any)
  23. // ServletContext application     -- The servlet (application) context
  24. // ServletConfig config           -- The ServletConfig for this JSP
  25. // Object page                    -- the instance of this page's implementation class (i.e., 'this')
  26. /**
  27. * This code was automatically generated at 21:23:31 on 2004-4-16
  28. * by weblogic.servlet.jsp.Jsp2Java -- do not edit.
  29. *
  30. * Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
  31. */
  32. public final class __reguser3
  33. extends
  34. weblogic.servlet.jsp.JspBase
  35. implements weblogic.servlet.jsp.StaleIndicator
  36. {
  37.     
  38.     // 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;     }               
  39.     
  40.     public void _jspService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException 
  41.     {  
  42.         
  43.         // declare and set well-known variables:
  44.         javax.servlet.ServletConfig config = getServletConfig();
  45.         javax.servlet.ServletContext application = config.getServletContext();
  46.         javax.servlet.jsp.tagext.Tag _activeTag = null;
  47.         // variables for Tag extension protocol         
  48.         Object page = this;
  49.         javax.servlet.jsp.JspWriter out;
  50.         javax.servlet.jsp.PageContext pageContext =         javax.servlet.jsp.JspFactory.getDefaultFactory().getPageContext(this, request, response, null, true, 8192, true);         
  51.         response.setHeader("Content-Type", "text/html; charset=GBK");         out = pageContext.getOut();         JspWriter _originalOut = out;         
  52.         javax.servlet.http.HttpSession session = request.getSession(true);         
  53.         
  54.         
  55.         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);         }                  
  56.         //before final close brace...
  57.     }
  58.     
  59.     
  60. }