用jsp实现在线留言!采用MVC三层架构!
源代码在线查看: modifyuser.jsp
User_Name=request.getParameter("name"); User_Name=yy.ex_chinese(User_Name); User_Password=request.getParameter("password"); User_Password=yy.ex_chinese(User_Password); User_Password1=request.getParameter("password2"); User_Password1=yy.ex_chinese(User_Password1); User_Sex=request.getParameter("sex"); User_Sex=yy.ex_chinese(User_Sex); User_Email=request.getParameter("email"); User_Address=request.getParameter("address"); User_Address=yy.ex_chinese(User_Address); User_Mobile=request.getParameter("mobile"); User_Oicq=request.getParameter("oicq"); User_Birthay=request.getParameter("birthday"); User_Birthay=yy.ex_chinese(User_Birthay); User_Icon=request.getParameter("icon"); User_Sign=request.getParameter("sign"); User_Sign=yy.ex_chinese(User_Sign); if (User_Email.equals("")) { response.sendRedirect("err.jsp?id=11"); return; }else { } if (!User_Password.equals(User_Password1)) { response.sendRedirect("err.jsp?id=9"); return; } if ((User_Password.length()12)) { response.sendRedirect("err.jsp?id=10"); return; } if ((User_Email.indexOf("@") { response.sendRedirect("err.jsp?id=13"); return; } Connection con=yy.getConn(); Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); sql="update 用户表 set 用户密码='"+User_Password+"',用户性别='"+User_Sex+"',用户邮箱='"+User_Email+"',居住地址='"+User_Address+"',手机号码='"+User_Mobile+"',Oicq='"+User_Oicq+"',出生日期='"+User_Birthay+"',用户图像='"+User_Icon+"',签名='"+User_Sign+"' where 用户名='"+session.getValue("UserName")+"'"; stmt.executeUpdate(sql); out.println("正在处理您的用户信息,请稍后..."); %>