📄 user_modify.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%>
<%@ page import="com.beifengkd.drp.sysmgr.*" %>
<%
//request.setCharacterEncoding("GB18030");
String userId = request.getParameter("userId");
String command = request.getParameter("command");
if(command != null && command.equals("modify")) {
User user = new User();
user.setUserId(request.getParameter("userId"));
user.setUserName(request.getParameter("userName"));
user.setPassword(request.getParameter("password"));
user.setContactTel(request.getParameter("contactTel"));
user.setEmail(request.getParameter("email"));
UserManager.getInstance().modifyUser(user);
out.println("提示:用户添加成功!");
}
//out.println(userId);
User user = UserManager.getInstance().findUserById(userId);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>修改用户</title>
<link rel="stylesheet" href="../style/drp.css">
<script src="../script/client_validate.js"></script>
<script type="text/javascript">
function goBack() {
window.self.location ="user_maint.jsp"
}
function modifyUser() {
if(document.getElementById("userName") == "") {
alert("用户名称不能为空");
return;
}
if(document.getElementById("password").value.length < 6) {
alert("用户密码不能小于6");
return;
}
with(document.getElementById("userForm")) {
method = "post";
action = "user_modify.jsp?command=modify"
submit();
}
}
</script>
</head>
<body class="body1">
<form name="userForm" id="userForm">
<div align="center">
<table width="95%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td>
</td>
</tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0"
height="25">
<tr>
<td width="522" class="p1" height="25" nowrap>
<img src="../images/mark_arrow_03.gif" width="14" height="14">
<b>系统管理>>用户维护>>修改</b>
</td>
</tr>
</table>
<hr width="97%" align="center" size=0>
<table width="95%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="22%" height="29">
<div align="right">
用户代码:
</div>
</td>
<td width="78%">
<input name="userId" type="text" class="text1" id="userId" value="<%=user.getUserId() %>"
size="10" maxlength="10" readonly="true">
</td>
</tr>
<tr>
<td height="26">
<div align="right">
<font color="#FF0000">*</font>用户名称:
</div>
</td>
<td>
<input name="userName" type="text" class="text1" id="userName" value="<%=user.getUserName() %>"
size="20" maxlength="20">
</td>
</tr>
<tr>
<td height="26">
<div align="right">
<font color="#FF0000">*</font>密码:
</div>
</td>
<td>
<label>
<input name="password" type="password" class="text1" value="<%=user.getPassword() %>"
id="password" size="20" maxlength="20">
</label>
</td>
</tr>
<tr>
<td height="26">
<div align="right">
联系电话:
</div>
</td>
<td>
<input name="contactTel" type="text" class="text1" value="<%=user.getContactTel() %>"
id="contactTel" size="20" maxlength="20">
</td>
</tr>
<tr>
<td height="26">
<div align="right">
email:
</div>
</td>
<td>
<input name="email" type="text" class="text1" id="email" value="<%=user.getEmail() %>"
size="20" maxlength="20">
</td>
</tr>
</table>
<hr width="97%" align="center" size=0>
<div align="center">
<input name="btnModify" class="button1" type="button"
id="btnModify" value="修改" onclick="modifyUser()">
<input name="btnBack" class="button1" type="button" id="btnBack"
value="返回" onclick="goBack()" />
</div>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -