用jsp java做一个修改登录密码的程序

我请讲解下,用jsp java做一个修改登录密码的程序?

谁能把代码给一下 或者给一些相关的网站 链接
就是点修改密码之后 出来一个框 里面有输入旧密码 新密码 然后点修改
我刚学JAVA才几天 非常感谢
最新回答
平胸小欧巴

2024-09-18 01:12:34

<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("异常!");
}
});
紫珺婳浅

2024-09-18 05:34:34

<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
你模仿不起

2024-09-18 05:52:19

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>
词家小生

2024-09-18 00:35:43

<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