|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
|
|
|
|
<%@ page isELIgnored="false" %>
|
|
|
|
|
<%
|
|
|
|
|
String path = request.getContextPath();
|
|
|
|
|
String path = request.getContextPath(); // 获取应用的上下文路径
|
|
|
|
|
%>
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
@ -15,16 +15,21 @@ String path = request.getContextPath();
|
|
|
|
|
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
|
|
|
|
|
<meta http-equiv="description" content="This is my page" />
|
|
|
|
|
|
|
|
|
|
<!-- 引入样式文件 -->
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="<%=path %>/css/base.css" />
|
|
|
|
|
|
|
|
|
|
<!-- 引入公共 JavaScript 文件 -->
|
|
|
|
|
<script language="JavaScript" src="<%=path %>/js/public.js" type="text/javascript"></script>
|
|
|
|
|
|
|
|
|
|
<!-- 用户删除操作的 JavaScript 函数 -->
|
|
|
|
|
<script language="javascript">
|
|
|
|
|
function userDel(id)
|
|
|
|
|
{
|
|
|
|
|
// 弹出确认框,确认是否删除
|
|
|
|
|
if(confirm('您确定删除吗?'))
|
|
|
|
|
{
|
|
|
|
|
window.location.href="<%=path %>/user?type=userDel&id="+id; //如果确认删除,则会跳转到这个界面,?后为传入的参数,提示用户信息删除完毕
|
|
|
|
|
// 如果确认删除,跳转到对应的删除页面,并传递用户 ID
|
|
|
|
|
window.location.href="<%=path %>/user?type=userDel&id="+id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
@ -36,28 +41,32 @@ String path = request.getContextPath();
|
|
|
|
|
<td height="14" colspan="14" background="<%=path %>/img/tbg.gif"> </td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr align="center" bgcolor="#FAFAF1" height="22">
|
|
|
|
|
<td width="4%">序号</td>
|
|
|
|
|
<td width="10%">账号</td>
|
|
|
|
|
<td width="10%">密 码</td>
|
|
|
|
|
<td width="10%">姓名</td>
|
|
|
|
|
<td width="10%">操作</td>
|
|
|
|
|
<td width="4%">序号</td> <!-- 序号 -->
|
|
|
|
|
<td width="10%">账号</td> <!-- 用户账号 -->
|
|
|
|
|
<td width="10%">密 码</td> <!-- 用户密码 -->
|
|
|
|
|
<td width="10%">姓名</td> <!-- 用户姓名 -->
|
|
|
|
|
<td width="10%">操作</td> <!-- 操作按钮 -->
|
|
|
|
|
</tr>
|
|
|
|
|
<c:forEach items="${requestScope.userList}" var="user" varStatus="ss"> <!-- 对于每一项 ,取得用户名,将序号初值设置为1-->
|
|
|
|
|
<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
|
|
|
|
|
<!-- 循环遍历用户列表,展示用户信息 -->
|
|
|
|
|
<c:forEach items="${requestScope.userList}" var="user" varStatus="ss">
|
|
|
|
|
<tr align='center' bgcolor="#FFFFFF"
|
|
|
|
|
onMouseMove="javascript:this.bgColor='red';"
|
|
|
|
|
onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
|
|
|
|
|
<td bgcolor="#FFFFFF" align="center">
|
|
|
|
|
${ss.index+1}
|
|
|
|
|
${ss.index+1} <!-- 设置序号,从 1 开始 -->
|
|
|
|
|
</td>
|
|
|
|
|
<td bgcolor="#FFFFFF" align="center">
|
|
|
|
|
${user.loginname}
|
|
|
|
|
${user.loginname} <!-- 显示用户账号 -->
|
|
|
|
|
</td>
|
|
|
|
|
<td bgcolor="#FFFFFF" align="center">
|
|
|
|
|
${user.loginpw}
|
|
|
|
|
${user.loginpw} <!-- 显示用户密码 -->
|
|
|
|
|
</td>
|
|
|
|
|
<td bgcolor="#FFFFFF" align="center">
|
|
|
|
|
${user.name}
|
|
|
|
|
${user.name} <!-- 显示用户姓名 -->
|
|
|
|
|
</td>
|
|
|
|
|
<td bgcolor="#FFFFFF" align="center">
|
|
|
|
|
<input type="button" value="删除" onclick="userDel(${user.id})"/> <!-- 删除时删除主键用户ID,完成对整个数据项的删除 -->
|
|
|
|
|
<!-- 删除按钮,点击后会调用 userDel 函数 -->
|
|
|
|
|
<input type="button" value="删除" onclick="userDel(${user.id})"/>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</c:forEach>
|
|
|
|
|