pwd_0002ejsp_jsp.java
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:8k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- import java.sql.*;
- import java.util.*;
- import proj112.*;
- import javax.servlet.*;
- import javax.servlet.http.*;
- import javax.servlet.jsp.*;
- import org.apache.jasper.runtime.*;
- public class pwd_0002ejsp_jsp extends HttpJspBase {
- // begin [file="/pwd.jsp";from=(5,0);to=(5,57)]
- // end
- static {
- }
- public pwd_0002ejsp_jsp( ) {
- }
- private static boolean _jspx_inited = false;
- public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
- }
- 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;
- String _value = null;
- try {
- if (_jspx_inited == false) {
- synchronized (this) {
- if (_jspx_inited == false) {
- _jspx_init();
- _jspx_inited = true;
- }
- }
- }
- _jspxFactory = JspFactory.getDefaultFactory();
- response.setContentType("text/html; charset=GBK");
- pageContext = _jspxFactory.getPageContext(this, request, response,
- "", true, 8192, true);
- application = pageContext.getServletContext();
- config = pageContext.getServletConfig();
- session = pageContext.getSession();
- out = pageContext.getOut();
- // HTML // begin [file="/pwd.jsp";from=(0,48);to=(1,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/pwd.jsp";from=(1,31);to=(2,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/pwd.jsp";from=(2,27);to=(3,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/pwd.jsp";from=(3,32);to=(4,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/pwd.jsp";from=(4,30);to=(5,0)]
- out.write("rn");
- // end
- // begin [file="/pwd.jsp";from=(5,0);to=(5,57)]
- proj112.dbconn a = null;
- boolean _jspx_speciala = false;
- synchronized (pageContext) {
- a= (proj112.dbconn)
- pageContext.getAttribute("a",PageContext.PAGE_SCOPE);
- if ( a == null ) {
- _jspx_speciala = true;
- try {
- a = (proj112.dbconn) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "proj112.dbconn");
- } catch (ClassNotFoundException exc) {
- throw new InstantiationException(exc.getMessage());
- } catch (Exception exc) {
- throw new ServletException (" Cannot create bean of class "+"proj112.dbconn", exc);
- }
- pageContext.setAttribute("a", a, PageContext.PAGE_SCOPE);
- }
- }
- if(_jspx_speciala == true) {
- // end
- // begin [file="/pwd.jsp";from=(5,0);to=(5,57)]
- }
- // end
- // HTML // begin [file="/pwd.jsp";from=(5,57);to=(16,3)]
- 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 ");
- // end
- // begin [file="/pwd.jsp";from=(16,5);to=(25,3)]
- String pwd="";
- String number=(String)session.getAttribute("id");
- String sql="";
- sql="SELECT * FROM student where stu_id='"+number+"'";
- ResultSet rs = a.executeQuery(sql);
- if(rs.next()){
- pwd=rs.getString("stu_password");
- }
- // end
- // HTML // begin [file="/pwd.jsp";from=(25,5);to=(29,31)]
- out.write("rnrn<SCRIPT LANGUAGE="javascript" >rn function b(){rn if(form2.pwd1.value!="");
- // end
- // begin [file="/pwd.jsp";from=(29,34);to=(29,37)]
- out.print(pwd);
- // end
- // HTML // begin [file="/pwd.jsp";from=(29,39);to=(57,32)]
- 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 学号: <font color="#FF3333">");
- // end
- // begin [file="/pwd.jsp";from=(57,35);to=(57,62)]
- out.print(session.getAttribute("id") );
- // end
- // HTML // begin [file="/pwd.jsp";from=(57,64);to=(57,122)]
- out.write("</font> 姓名: <font color="#FF3333">");
- // end
- // begin [file="/pwd.jsp";from=(57,125);to=(57,158)]
- out.print(session.getAttribute("stu_name") );
- // end
- // HTML // begin [file="/pwd.jsp";from=(57,160);to=(84,0)]
- 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");
- // end
- } catch (Throwable t) {
- if (out != null && out.getBufferSize() != 0)
- out.clearBuffer();
- if (pageContext != null) pageContext.handlePageException(t);
- } finally {
- if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
- }
- }
- }