pwd_0002ejsp_jsp.java
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:8k
源码类别:

Jsp/Servlet

开发平台:

VBScript

  1. import java.sql.*;
  2. import java.util.*;
  3. import proj112.*;
  4. import javax.servlet.*;
  5. import javax.servlet.http.*;
  6. import javax.servlet.jsp.*;
  7. import org.apache.jasper.runtime.*;
  8. public class pwd_0002ejsp_jsp extends HttpJspBase {
  9.     // begin [file="/pwd.jsp";from=(5,0);to=(5,57)]
  10.     // end
  11.     static {
  12.     }
  13.     public pwd_0002ejsp_jsp( ) {
  14.     }
  15.     private static boolean _jspx_inited = false;
  16.     public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
  17.     }
  18.     public void _jspService(HttpServletRequest request, HttpServletResponse  response)
  19.         throws java.io.IOException, ServletException {
  20.         JspFactory _jspxFactory = null;
  21.         PageContext pageContext = null;
  22.         HttpSession session = null;
  23.         ServletContext application = null;
  24.         ServletConfig config = null;
  25.         JspWriter out = null;
  26.         Object page = this;
  27.         String  _value = null;
  28.         try {
  29.             if (_jspx_inited == false) {
  30.                 synchronized (this) {
  31.                     if (_jspx_inited == false) {
  32.                         _jspx_init();
  33.                         _jspx_inited = true;
  34.                     }
  35.                 }
  36.             }
  37.             _jspxFactory = JspFactory.getDefaultFactory();
  38.             response.setContentType("text/html; charset=GBK");
  39.             pageContext = _jspxFactory.getPageContext(this, request, response,
  40.              "", true, 8192, true);
  41.             application = pageContext.getServletContext();
  42.             config = pageContext.getServletConfig();
  43.             session = pageContext.getSession();
  44.             out = pageContext.getOut();
  45.             // HTML // begin [file="/pwd.jsp";from=(0,48);to=(1,0)]
  46.                 out.write("rn");
  47.             // end
  48.             // HTML // begin [file="/pwd.jsp";from=(1,31);to=(2,0)]
  49.                 out.write("rn");
  50.             // end
  51.             // HTML // begin [file="/pwd.jsp";from=(2,27);to=(3,0)]
  52.                 out.write("rn");
  53.             // end
  54.             // HTML // begin [file="/pwd.jsp";from=(3,32);to=(4,0)]
  55.                 out.write("rn");
  56.             // end
  57.             // HTML // begin [file="/pwd.jsp";from=(4,30);to=(5,0)]
  58.                 out.write("rn");
  59.             // end
  60.             // begin [file="/pwd.jsp";from=(5,0);to=(5,57)]
  61.                 proj112.dbconn a = null;
  62.                 boolean _jspx_speciala  = false;
  63.                  synchronized (pageContext) {
  64.                     a= (proj112.dbconn)
  65.                     pageContext.getAttribute("a",PageContext.PAGE_SCOPE);
  66.                     if ( a == null ) {
  67.                         _jspx_speciala = true;
  68.                         try {
  69.                             a = (proj112.dbconn) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "proj112.dbconn");
  70.                         } catch (ClassNotFoundException exc) {
  71.                              throw new InstantiationException(exc.getMessage());
  72.                         } catch (Exception exc) {
  73.                              throw new ServletException (" Cannot create bean of class "+"proj112.dbconn", exc);
  74.                         }
  75.                         pageContext.setAttribute("a", a, PageContext.PAGE_SCOPE);
  76.                     }
  77.                  } 
  78.                 if(_jspx_speciala == true) {
  79.             // end
  80.             // begin [file="/pwd.jsp";from=(5,0);to=(5,57)]
  81.                 }
  82.             // end
  83.             // HTML // begin [file="/pwd.jsp";from=(5,57);to=(16,3)]
  84.                 out.write("rn<html>rn<head>rn<meta http-equiv="Content-Type" content="text/html; charset=gb2312";>rn<title>rnchangern</title>rn</head>rn<body bgcolor="#ffffff">rnrnrn   ");
  85.             // end
  86.             // begin [file="/pwd.jsp";from=(16,5);to=(25,3)]
  87.                 
  88.                    String pwd="";
  89.                    String number=(String)session.getAttribute("id");
  90.                    String sql="";
  91.                      sql="SELECT * FROM student where stu_id='"+number+"'";
  92.                      ResultSet rs = a.executeQuery(sql);
  93.                      if(rs.next()){
  94.                        pwd=rs.getString("stu_password");
  95.                      }
  96.                    
  97.             // end
  98.             // HTML // begin [file="/pwd.jsp";from=(25,5);to=(29,31)]
  99.                 out.write("rnrn<SCRIPT LANGUAGE="javascript" >rn function b(){rn         if(form2.pwd1.value!="");
  100.             // end
  101.             // begin [file="/pwd.jsp";from=(29,34);to=(29,37)]
  102.                 out.print(pwd);
  103.             // end
  104.             // HTML // begin [file="/pwd.jsp";from=(29,39);to=(57,32)]
  105.                 out.write(""||form2.pwd1.value=="")rn         {rn                alert("输入的原始密码不正确,请重新输入");rn                form2.pwd1.focus();rn                return false;rn         }rn           if(form2.pwd2.value=="")rn           {rn                   alert("请输入新密码");rn                   form2.pwd2.focus();rn                 return false;rn                  }rnrnrn            else if(form2.pwd2.value!=form2.pwd3.value)rn              {rn                 alert("两次输入的新密码不同,请重新输入");rn                 form2.pwd3.focus();rn                 return false;rn              }rn             elsern            {rn              alert("密码修改成功");rn              return true;rn            }rn            return true;rn }rn</SCRIPT>rn 学号:&nbsp;<font color="#FF3333">");
  106.             // end
  107.             // begin [file="/pwd.jsp";from=(57,35);to=(57,62)]
  108.                 out.print(session.getAttribute("id") );
  109.             // end
  110.             // HTML // begin [file="/pwd.jsp";from=(57,64);to=(57,122)]
  111.                 out.write("</font>&nbsp; &nbsp; &nbsp;姓名:&nbsp;<font color="#FF3333">");
  112.             // end
  113.             // begin [file="/pwd.jsp";from=(57,125);to=(57,158)]
  114.                 out.print(session.getAttribute("stu_name") );
  115.             // end
  116.             // HTML // begin [file="/pwd.jsp";from=(57,160);to=(84,0)]
  117.                 out.write(" </font> <br>rn <hr><br>rnrnrn <center>rn <form action="update_pwd.jsp" method="POST" name="form2">rnrn<TABLE width="80%"style="BORDER-RIGHT: #cc9966 1px; BORDER-TOP: #cc9966 1px; BORDER-LEFT: #cc9966 1px; WIDTH: 100%; BORDER-BOTTOM: #cc9966 1px; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: white"rnborderColor=#cc9966 cellSpacing=0 cellPadding=4 rules=all border=1>rn   <tr align="center"><td  colspan="2" align="center"><font size="4" color="#FF3333">密码修改</font></td></tr>rn  <tr align="center">rn    <td  align="right">请输入原密码</td><td  align="left"><input type="password" name="pwd1"  size="15"> </td>rn  </tr>rn  <tr align="center">rn    <td  align="right">请输入新密码</td> <td  align="left"><input type="password" name="pwd2" size="15"> </td>rn  </tr>rn  <tr align="center">rn  <td  align="right">确认新密码</td><td  align="left"> <input type="password" name="pwd3" size="15" > </td>rn  </tr>rn  <tr align="center">rn  <td  align="right"><input type="submit" name="a1" value="确认" onclick="return b()"> </td><td  align="left"> <input type="reset" name="a2" value="重写"></td>rn  </tr>rn </table>rn  </form>rn </center>rn</body>rn</html>rn");
  118.             // end
  119.         } catch (Throwable t) {
  120.             if (out != null && out.getBufferSize() != 0)
  121.                 out.clearBuffer();
  122.             if (pageContext != null) pageContext.handlePageException(t);
  123.         } finally {
  124.             if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
  125.         }
  126.     }
  127. }