📄 changepwd.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'changePwd.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script language="javascript">
function check(){
var oldPwd = document.forms[0].oldPwd.value;
var newPwd = document.forms[0].newPwd.value;
var ensureNewPwd = document.forms[0].ensureNewPwd.value;
if( (oldPwd.length<=0)||(newPwd.length<=0)||(ensureNewPwd.length<=0) ){
alert("请填写完整信息!");
}else{
if(newPwd == ensureNewPwd){
document.forms[0].submit();
}else{
alert("新密码与确认密码不致!");
}
}
}
</script>
</head>
<body bgcolor="D9EAFC">
<%
String errorInfo = request.getParameter("errInfo");
if(errorInfo!=null){
if(errorInfo.equals("pwd_error")){
out.println("<p align=center><font color=red>您输入的当前密码错误,修改失败!</font></p>");
}
else if(errorInfo.equals("null_error")){
out.println("<p align=center><font color=red>修改密码成功,请记住您的新密码!</font></p>");
}
else if(errorInfo.equals("changepwd_error")){
out.println("<p align=center><font color=red>修改密码失败!</font></p>");
}
else if(errorInfo.equals("nulluser_error")){
out.println("<p align=center><font color=red>您还未登录,请重新<a href='../exit.jsp'>登录</a>!</font></p>");
}
}
%>
<p align="center"><font color="2244aa" size="6"> 修 改 密 码</font></p>
<form methos="post" action="servlet/UserServlet">
<input type="hidden" name="action" value="changePwd"/>
<table align="center" >
<tr>
<td align="left">
请输入您当前使用的密码:
</td>
<td>
<input type="password" name="oldPwd">
</td>
</tr>
<tr>
<td align="left">
请输入新密码:
</td>
<td>
<input type="password" name="newPwd">
</td>
</tr>
<tr>
<td align="left">
请输入密码确认:
</td>
<td>
<input type="password" name="ensureNewPwd">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="提交修改" onclick="return check()">
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -