我请讲解下,用jsp java做一个修改登录密码的程序? 谁能把代码给一下 或者给一些相关的网站 链接 就是点修改密码之后 出来一个框 里面有输入旧密码 新密码 然后点修改我刚学JAVA才几天 非常感谢
<a>修改密码</a><table align="center"><tr><td>旧密码:</td><td><input type="password" name="password" size="10" /></td></tr><tr> <td>新密码</td><td><input type="password" name="password1" size="10" /></td></tr><tr> <td>确认密码</td><td><input type="password" name="password2" size="10" /></td></tr><td calspan="2"><input type="submit" name="submit" value="修改"></td></table>//1.$.ajax带json数据的异步请求var aj = $.ajax( { url:'passwordUpdate',// 跳转到修改密码的 action data:{ oldpass: old, mobile: mobileNo, PROVINCECODE : PROVINCECODE}, type:'post', cache:false, dataType:'json', success:function(data) { if(data.msg =="true" ){ // view("修改成功!"); alert("修改成功!"); window.location.reload(); }else{ view(data.msg); } }, error : function() { // view("异常!"); alert("异常!"); } });
<html> <head> <base href="<%=basePath%>"> <title>修改用户信息</title> </head> <script language="JavaScript"> function update(){ if(window.document.userLoginForm.newPassWord.value != window.document.userLoginForm.againPassWord.value) { alert("两次密码输入不一致,请重新输入"); return false; } window.document.userLoginForm.passWord.value = window.document.userLoginForm.newPassWord.value; window.document.userLoginForm.action="./userUpdate.do"; window.document.userLoginForm.submit(); } function back() { window.document.userLoginForm.action="./module.do?method=Find"; window.document.userLoginForm.submit(); } </script> <body> <form id="userLoginForm" name="userLoginForm" method="post"> <table width="300" align="center" border="1"> <tr> <td>原始密码: <input type="password" name="oldPassWord"><font color="#FF0000">*</font></td> </tr> <tr> <td>新密码: <input type="password" name="newPassWord"><font color="#FF0000">*</font></td> </tr> <tr> <td>验证新密码:<input type="password" name="againPassWord"><font color="#FF0000">*</font></td> </tr> <tr> <td><input type="hidden" name="passWord"></td> </tr> <tr align="center"> <td><font color="#FF0000"><html:errors bundle="system" property="error" /></font></td> </tr> <tr> <td> <input type="button" value="修 改" onclick="update()"> <input type="button" value="返 回" onclick="back()"></td> </tr> </table> </form> </body> </html>http://download.csdn.net/source/363681
Index.jsp <script language="javascript"> function clickShow() { //如果向你说的弹出一个框,在window.open()里面加参数,height width scrollbar 等等,挺多,你自己查一下Window.open(“update.jsp”); }</script><html> <input type=”button” value=”修改密码” onclick=”javascript:clickShow()”></html>Update.jsp <html><script language="javascript"> Function validate() { //验证pw1、pw2是否一致,验证3个密码长度是否大于你规定的最小位数等等} </script> 原始密码:<input type=”text” name=”pw”> 新密码<input type=”text” name=”pw1”> 确认新密码<input type=”text” name=”pw2”> <input type=”button” value=”修改” onclick=”validate”> </html>
<html><head><basehref="<%=basePath%>"><title>修改用户信息</title></head><scriptlanguage="JavaScript">functionupdate(){if(window.document.userLoginForm.newPassWord.value!=window.document.userLoginForm.againPassWord.value){alert("两次密码输入不一致,请重新输入");returnfalse;}window.document.userLoginForm.passWord.value=window.document.userLoginForm.newPassWord.value;window.document.userLoginForm.action="./userUpdate.do";window.document.userLoginForm.submit();}functionback(){window.document.userLoginForm.action="./module.do?method=Find";window.document.userLoginForm.submit();}</script><body><formid="userLoginForm"name="userLoginForm"method="post"><tablewidth="300"align="center"border="1"><tr><td>原始密码:<inputtype="password"name="oldPassWord"><fontcolor="#FF0000">*</font></td></tr><tr><td>新密码:<inputtype="password"name="newPassWord"><fontcolor="#FF0000">*</font></td></tr><tr><td>验证新密码:<inputtype="password"name="againPassWord"><fontcolor="#FF0000">*</font></td></tr><tr><td><inputtype="hidden"name="passWord"></td></tr><tralign="center"><td><fontcolor="#FF0000"><html:errorsbundle="system"property="error"/></font></td></tr><tr><td><inputtype="button"value="修改"onclick="update()"><inputtype="button"value="返回"onclick="back()"></td></tr></table></form></body></html>http://download.csdn.net/source/363681